How to resolve conflict issues with jQuery + other libraries
Can someone help me figure out how to write a no conflict function for js for my w开发者_开发技巧eebly website.
http://cadogan.weebly.com/big-name.html
Thank you.
I assume you mean that you get errors when you try to reference jQuery using $.
Since you are loading Scriptaculous after jQuery, it is overwriting the $ alias to jQuery. You can instead us the jQuery object directly.
jQuery(function() {
jQuery('#mydiv').html("<h1>hi</h1>");
});
You could try using jQuery
instead of $
, or using the .noConflict()
method:
http://api.jquery.com/jQuery.noConflict/
精彩评论