Make jQuery work on the same page with Mootools and or Prototype
Some conflicts appear when using jQuery javascript library with Motools or Prototype on the same page. A workaround is using noConflict mode for jQuery.
Follow these steps:
1. Download the latest version of jQuery
2. Download jQuery compat
3. Open jquery.js, go to the end of the file and add this line jQuery.noConflict();
4. With jquery.js opened, open jquery.compat-1.0.js copy all it's content and paste-it after jQuery.noConflict(); line in jquery.js.
5. Find these lines and comment or delete them:
jQuery.fn._filter = jQuery.fn.filter;
jQuery.fn.filter = function(arr){
return this._filter( arr.constructor == Array ? arr.join(",") : arr );
};
6. Open all .js files that use jQuery library and add as the first line (function($){ and as the last line })(jQuery);
(function($){
content of the .js file
})(jQuery);
That's it.



Thanks pal, I was struggling with this conflict for long time. You solution helped me out.
Thanks
Arpit
outstanding... that did just the trick. kudos chap.
Post new comment