HowTo:Using more than one jquery version

Official Content

As of Evolution 3, GeneXus distributes jquery 1.9.1 and uses this jquery version for the generated applications.

When you develop a User Control, it is recommended to use the same jquery version distributed by GeneXus if possible, so it isn't necessary to include and reference another one.

If this isn't possible because of the requirements of the user control being developed, the jquery has to be disambiguated to avoid conflicts.

GeneXus disambiguates the jquery used, with the namespace "gx", by the following code:

 gx.$ = jquery.noconflict()

If you need to use another jquery version, it is advisable to use the same criterion.

Example

Consider a user control named "MyUserControl". 
In the HTML header, the following scripts are included:

1. jquery distributed by GeneXus
2. javascript of "MyUserControl"
3. jquery used by "MyUserControl"

Using the $ alias, you cannot be sure which is the jquery which is being referenced, so the recommendation is to use the noconflict jquery method to disambiguate:

function MyUserControl()
{
// Inside here use MyUserControl.$ instead of $
}

MyUserControl.$ = jQuery.noConflict()

Follow this link to know more about the topic.

For another useful link, click here.

Tip:

If you need to know if the jquery being used is the one distributed by GeneXus, run the following command line in the javascript console:

gx.$===$

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.