简体   繁体   English

如何并排使用两个不同版本的jQuery?

[英]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.

相关问题 如何将相同的jQuery悬停动画应用于并排不同高度的两个div? - How can I apply the same jQuery hover animation to two divs of different height side-by-side? 如何并排制作两个引导按钮? - How do I make two bootstrap buttons side by side? 如何让这两个元素并排对齐? - How do I get these two elements to align side by side? 如何在客户端使用来自服务器端的数据? - How do I use data from the server side on the cliente side? 如何使用jQuery对div标签进行客户端排序? - How do I use jQuery for client-side sorting of div tags? 如何使用JQuery Ajax在服务器端调用PHP文件以返回并执行JavaScript? - How do i use JQuery Ajax to call a PHP file on the server side to return and execute javascripts? 如何在Jquery中列出项目并在服务器端获取它? - How do I do a list of items in Jquery and get it on server side? JsPDF Autotable:如何并排显示跨越多个页面的两个表格? - JsPDF Autotable: How do I display two tables side by side that span multiple pages? 在ExtJS中,如何将两个字段集并排放置在具有hbox布局的面板中? - In ExtJS, how do I place two fieldsets side-by-side in a panel with a hbox layout? 如何在jQuery mobile中并排显示两个文本输入? - How to display two text inputs side by side in jQuery mobile?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM