Bala
Bala

Reputation: 3638

How to fix the jquery version compatibility issue?

In the project which am working, we use alot of jquery plugins to make it work exactly the way we want. We use jquery 1.5 as a common version of jquery library for all the plugins. But some plugins works only on jquery library version 1.3 and few other works on jquery 1.7 version. We really don't think using more than one version of jquery in the same project is a good idea.

How can i make all the plugins work with one jquery file ? any fixes ? any ideas ? please share with me as this is really frustrating that we couldn't progress more in the development.

Upvotes: 4

Views: 4343

Answers (3)

jfriend00
jfriend00

Reputation: 707218

The only way to answer this is to examine each and every plug-in you're using that doesn't work with 1.7, figure out why it doesn't work and patch/fix it or switch to some other plug-ins with similar functionality that does work with the desired jQuery version. There is no other magic bullet.

If you want all your plugins to work with the same jQuery version, then you have to make all your plug-ins work with the same jQuery version. Were you expecting something else?

I don't know how you expect us to help further without even telling us know which plug-ins they are or what the issues are with which versions of jQuery.

Upvotes: 1

xkeshav
xkeshav

Reputation: 54016

below are some articles that may be helpful for both of us

http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/

How do I run different versions of jQuery on the same page?

http://jquery-howto.blogspot.com/

jQuery forum

Using jQuery.noConflict, you can make multiple versions of jQuery coexist on the same page. For instance

<script src='jquery-1.3.2.js'></script>
<script>
var jq132 = jQuery.noConflict();
</script>
<script src='jquery-1.4.2.js'></script>
<script>
var jq142 = jQuery.noConflict();
</script>

Upvotes: 1

isNaN1247
isNaN1247

Reputation: 18099

Anything that works with 1.5 should work with 1.7 as not a lot was removed to the best of my knowledge.

In terms of the plugin(s) that works only with 1.3, I'd look into replacing that... its very rare to find a jQuery plugin that doesn't have a few other similar plugins which are more regularly updated.

As a general rule of thumb, you want to make sure that you only use plugins (as with other dependancies in code) that are updated on a regular basis. Therefore those that only support 1.3 should be ditched as soon as possible.

You should only ever use a recent copy of jQuery. Any third-party code that locks you into using an 'old' version isn't worth keeping.

Upvotes: 1

Related Questions