[英]How do I use two different versions of jQuery side by side?
I'm writing a wrapper for Yahoo Web Analytics at work. 我正在为Yahoo Web Analytics编写包装。 My wrapper has jQuery 1.5.3 built-in, while the page where I'm installing the wrapper uses jQuery 1.4.3.
我的包装器内置了jQuery 1.5.3,而我安装包装器的页面则使用jQuery 1.4.3。 When I include my wrapper, their site fails, due to what I'm guessing is the updated Ajax functions in jQuery 1.5.3.
当我包含包装器时,由于我猜是jQuery 1.5.3中更新了Ajax函数,所以它们的站点失败了。
Is there any way I can include jQuery without overwriting the previously included jQuery scripts? 有什么方法可以包含jQuery而不会覆盖以前包含的jQuery脚本?
Them upgrading their page is unfortunately not an option. 不幸的是,他们不能升级他们的页面。 Neither is downgrading our tracking script.
也不降级我们的跟踪脚本。
var $yournamespece = jQuery.noConflict(true);
// now use $yournamespace instead of $
$yournamespace('selector')
Though I'm curious as to what your script uses that is not compatible with their version...1.5 hasn't really been out all that long 虽然我很好奇,你的脚本使用什么,是不是他们的版本兼容... 1.5还没有真正被淘汰所有的长
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.