I am working on a project that has two versions of jQuery loaded on a page (versions 1.5.1 and 1.7.2). The 1.5 version is for an implementation of jsTree, and the 1.7 version is for the latest version of jqGrid.
I understand the performance implications of downloading two versions of jQuery and also the potential for name collisions, but has anyone run into a situation like this and are there inherent problems that the page will encounter because of this.
Currently, the site runs fine and I’m not noticing any significant issues that could be caused by different versions of jQuery on the page. But I cannot quickly remove one version or the other, as it seems to cause one or the other control (the tree or the grid) to crash.
I need to remove one version of jQuery. I am looking for advice on what potentials problems to expect with two versions of jQuery on the page and advice on how to go about removing one reference. And, if there is anyone that thinks it’s fine to have both versions, any thoughts on why I should just leave well enough alone.
Thanks in advance!
You can definitely run two versions of jQuery on one web page. The only downside is the additional http request.
However, making 1.5 code run in 1.7 isn’t very difficult. Get rid of the 1.5 and make sure that 1.7 is above all of the plugins that require jquery and see what breaks. Post here or in the jQuery forums for support on fixing those small issues.
The most likely change you will have to make is changing a few
.attr()calls to.prop()due to a change in 1.6.Edit:
It would also be wise to follow Robert Harvey’s advice and upgrade jsTree to the latest version.