Using multiple versions of jQuery on same page

This example shows how we can use multiple versions of jQuery on the same page. It’s simple and very easy to use multiple versions using jQuery.noConflict(true). This jQuery.noConflict(true) was introduced in jQuery version 1.1. There are various reasons behind using the multiple versions of jQuery. Reasons are like you have already used a particular version jQuery and you don’t want to replace the old version and want to additionally use the new version of jQuery to get all new features; you don’t want to replace the old version because the new version is not compatible for certain functionality as old one; you don’t have template for your web pages and if you want to replace the old version then you may not guess on how many pages you need to replace etc.
Suppose you want to use jQuery version 1.3.2 and 1.11.1 on the same web page then you need to include the jQuery in <head/> section as follows:

 

In the above example we see that we have declared varibles for each version of jQuery and whereever we want to use a particular version of jQuery then we will use using the variable instead of $ or jQuery variable.

Usage example:

 

The above example is very easy to understand. The see the console output you need to use Firebug tool in Firefox or Chrome Developer tool or IE Developer tool.

Full example:

 

Thanks for your reading. Please do not forget to leave a comment.

Soumitra

Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.