简体   繁体   English

解决多个jQuery文件之间的冲突

[英]Resolving conflict between multiple jQuery files

I have multiple jquery files in my project. 我的项目中有多个jquery文件。 I am using facebox using jquery1.4.2 but i need prototype and scriptacolous scripts too. 我使用jquery1.4.2使用facebox但我也需要原型和scriptacolous脚本。 I have used jQuery.noconflict(); 我用过jQuery.noconflict(); in my code but its not working. 在我的代码中但它不起作用。 this is the url http://mlep.com/~avalon/wordpress/ideas-and-insights/case-studies/ . 这是网址http://mlep.com/~avalon/wordpress/ideas-and-insights/case-studies/

it should be in this manner of arrangement, 它应该采用这种安排方式,

  1. load other libraries and other non-jQuery scripts 加载其他库和其他非jQuery脚本
  2. load jQuery library. 加载jQuery库。
  3. call jQuery.noConflict. 调用jQuery.noConflict。
  4. load jQuery plugins 加载jQuery插件
  5. other jQuery stuff or codes.. 其他jQuery的东西或代码..

codes like this, 像这样的代码,

<script type="text/javascript" src="http://mlep.com/~avalon/wordpress/wp-content/themes/twentyten/facebox/jquery14.js"></script> 
<script type="text/javascript"> 
    var ang = jQuery.noConflict();
</script>
<script type="text/javascript" src="http://mlep.com/~avalon/wordpress/wp-content/themes/twentyten/facebox/facebox.js"></script> 
<script type="text/javascript"> 
   // other jQuery Codes here...
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM