- The jQuery library needs to be loaded AFTER the Prototype library, and BEFORE any Prototype functions are called.
- Immediately after loading the jQuery library, add the following to your code:
var $j = jQuery;
- Any time you want to call jQuery functions, you can do so with the new shortcut $j, or in long-form, jQuery. The following code is equivalent after defining the $j variable as outlined above:
As an aside, remember that if you’re switching from Prototype to jQuery, any time you want to reference a div you need to add the ‘#’ symbol in front of the name of the div. So this Prototype code:
There you go, now you can get Prototype’s superior AJAX functions, and jQuery’s awesome effects, without having to deal with Scriptaculous.