jQuery is undoubtedly one of the well known Ajax and JavaScript frameworks. Developed in the early days of Ajax, the framework eventually became the staple of various developers because of its ability to provide various functions for a variety of purposes. Because of its impact on JavaScript, Microsoft has even teamed with this framework as part of their offering in ASP.Net. Aside from powerful support from jQuery, developers around the world have also developed various libraries based on this framework.
The ease of implementation of jQuery in various settings was made possible because of its consistent update. While the early version of jQuery is already impressive, there are situations wherein jQuery might not provide the needed solution. But the update of jQuery is not necessarily a move forward.
There are times that some of the functions were removed or changed which might not work well in various settings. For that reason, some developers ignore the updates from jQuery or forced to use a different framework. Some also use mash-ups so that they can use the same version while providing upgrades in their online application.
But you can also use two versions of jQuery in one Ajax or JavaScript based application. There are two solutions possible for this problem.
The Non-IE Solution (or the Easy Method)
This solution will allow you to load two or more versions of jQuery in one application. In this method, you will simply use two important functions before loading the script from a different version.
The first function is to inform the JavaScript engine that you are loading a different script so you need to have a noConflict function. The function is:
jQuery.noConflict()
You need to set the function to (true) if you want to allow two versions. Of course, using (false) will simply switch the function with a different version off.
The second function is the loading function that will indicate the jQuery version. For example:
load("jquery","version")
If you choose to use Google as the source simply use google.load as the initial function.
The IE Solution (Longer Method)
If you anticipate that your application will be used in IE or if your application will be used by anyone, then you need to use the dynamic loading technique. Basically, this technique can be used if you will be aggressively using a totally different framework.
In this technique, the additional framework merely becomes a node. The only difference is that you can directly point to the source of the library instead of going through append functions just to load a different version of jQuery. A good example is indicating the full URL of the Google API on jQuery so that it can work in the application.
There is a tendency that the longer method will be used every time to avoid future problems. But if you are creating an application for local use, you can force your users to use non-IE browsers since this method is easier for developers and can be easily interpreted by the JavaScript engine. Using non-IE for users is a small sacrifice for a better working application.