jQuery的多个文件之间解决冲突 [英] Resolving conflict between multiple jQuery files

查看:119
本文介绍了jQuery的多个文件之间解决冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目多的jQuery文件。我使用facebox使用jquery1.4.2,但我需要雏形和scriptacolous脚本了。我已经使用jQuery.noconflict();在我的code,但它不工作。 这是URL http://mlep.com /〜阿瓦隆/字preSS /主意 - 和 - 洞察/案例研究/

I have multiple jquery files in my project. I am using facebox using jquery1.4.2 but i need prototype and scriptacolous scripts too. I have used jQuery.noconflict(); in my code but its not working. this is the url http://mlep.com/~avalon/wordpress/ideas-and-insights/case-studies/.

推荐答案

就应该在安排这种方式,

it should be in this manner of arrangement,

  1. 在加载其他图书馆和其他非jQuery的脚本
  2. 在加载jQuery库。
  3. 打电话jQuery.noConflict。
  4. 负载jQuery插件
  5. 在其他的jQuery的东西或codeS ..

codeS这样,

<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>

这篇关于jQuery的多个文件之间解决冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆