Use Multiple jQuery and jQuery UI Libraries
Is there a way to use multiple jQuery and jQuery UI Libraries in the same source?
I know about noConflict a开发者_C百科nd using multiple jQuery Libraries with this method, however is it possible to use multiple jQuery UI Libraries?
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
and then for everything else use the latest jQuery Libraries of 1.4.2 and UI 1.8.
Thanks,
-Seth
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>
To use version1.4, you use $jq('#id'); To use version 1.3, you use $('#id');
In short, no this is not supported. You best bet is to upgrade everything to jQuery 1.4.2 and jQuery UI 1.8 and fix whatever is broken.
This also means around half the amount of javascript the client has to run, a better experience for them (plus jQuery has made major performance improvements in their releases since 1.2.6)
精彩评论