开发者

How to resolve conflict issues with jQuery + other libraries

开发者 https://www.devze.com 2023-04-11 03:01 出处:网络
Can someone help me figure out how to write a no conflict function for js for my w开发者_开发技巧eebly website.

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号