[英]Using different version of jquery on different ASP.NET MVC
I am currently working in NOPCommerce 3.0 site which is currently using JQuery 1.7 . 我目前正在NOPCommerce 3.0站点中工作, 该站点当前正在使用JQuery 1.7 。 All of its pages have dependency on that.
它的所有页面都依赖于此。 in the site I have created a section which i have created using JQuery 2.0 (that part is not supported in 1.7 so i have to use 2.0).
在站点中,我创建了一个使用JQuery 2.0创建的部分(1.7中不支持该部分,因此我必须使用2.0)。 So now how can i change the reference so that My partial View use JQuery 2.0 instead JQuery 1.7
所以现在我该如何更改引用,以便我的局部视图使用JQuery 2.0而不是JQuery 1.7
I already put script tag to create another reference but it just give me errors due to JQuery Conflicting in the try 我已经放置了脚本标记来创建另一个引用,但是由于尝试中的JQuery冲突,它只是给我错误
Found this on Can I use multiple versions of jQuery on the same page? 可以在同一页面上使用多个版本的jQuery吗?
<!-- load jQuery 1.1.3 -->
<script type="text/javascript" src="http://example.com/jquery-1.1.3.js"></script>
<script type="text/javascript">
var jQuery_1_1_3 = $.noConflict(true);
</script>
<!-- load jQuery 1.3.2 -->
<script type="text/javascript" src="http://example.com/jquery-1.3.2.js"></script>
<script type="text/javascript">
var jQuery_1_3_2 = $.noConflict(true);
</script>
Then, instead of
$('#selector').function();, you'd do jQuery_1_3_2('#selector').function();
or jQuery_1_1_3('#selector').function();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.