使用多个jQuery和jQuery用户界面库 [英] Use Multiple jQuery and jQuery UI Libraries
问题描述
有没有使用多个jQuery和jQuery用户界面库在同一个源的方式?
Is there a way to use multiple jQuery and jQuery UI Libraries in the same source?
我知道noConflict并使用这种方法多的jQuery库,但是否有可能使用多个jQuery UI的图书馆?
I know about noConflict and using multiple jQuery Libraries with this method, however is it possible to use multiple jQuery UI Libraries?
基本上我想使用jQuery 1.2.6和jQuery UI 1.6,共同为网页的某一部分,只有拥有这些库的工作原理
Essentially I would like to use jQuery 1.2.6 and jQuery UI 1.6 together for a certain portion of the page that only works with those libraries
,然后一切使用1.4.2和UI 1.8。最新的jQuery库
and then for everything else use the latest jQuery Libraries of 1.4.2 and UI 1.8.
谢谢,
-Seth
推荐答案
jQuery不会有一个NoConflict方法,允许这一点。您可以通过创建多个版本的jQuery的一个实例:
jquery does have a NoConflict method that allows for this. You can create an instances of multiple jquery versions using:
<script src="jQuery1.4.1.js"></script>
<script>
$jq = jQuery.noConflict(true);
</script>
<script src="jQuery1.3.2.js"></script>
要使用version1.4,你用JQ $('#ID');
要使用1.3版本,可以使用$('#ID');
To use version1.4, you use $jq('#id'); To use version 1.3, you use $('#id');
这篇关于使用多个jQuery和jQuery用户界面库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!