Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好的,所以我在一页中使用 jQuery 1.5 和 Google Data API 库,而 jQuery 根本没有触发。它们是否相互干扰,如果是,我该如何解决?
您可以使用 jQuery 的 noconflict() 给它自己的命名空间
http://api.jquery.com/jQuery.noConflict/
除了像 Crayon 建议的那样使用 noconflict() 之外(这是一个很好的答案,+1),您还可以使用 jquery 而不是 $ 来调用 jquery。所以,例如......而不是......
$(function() { ... });
你会做的
jQuery(function() { ... });
这避免了其他使用 $ 的库之间的任何冲突。