Search code examples
javascriptjqueryprototypejsconflict

Why is there still a conflict between prototype and jquery?


I've already read about how to load prototype and jquery together but these techniques are not solving the problem.

I load jquery then this file (http://music.glumbo.com/izzyFeedback.js) and then prototype.

I've wrapped parts that use $ in izzyFeedback.js in

(function($) {  

})(jQuery);

but this does not work. If I comment out the prototype load then it works correctly.


Solution

  • Did you put jQuery.noConflict(); before the (function($) { })(jQuery) wrapper?

    There are some other techniques in the docs http://api.jquery.com/jQuery.noConflict/

    I've had previous success using var j = jQuery.noConflict(); and replacing all instances of $ and jQuery with j.