Seth Duncan
Seth Duncan

Reputation: 1265

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 and 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

Upvotes: 0

Views: 803

Answers (2)

derek
derek

Reputation: 4886

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');

Upvotes: 2

Nick Craver
Nick Craver

Reputation: 630569

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)

Upvotes: 1

Related Questions