We have had issues with Mootools not being very backward compatible specifically in the area of drag and drop functionality. I was wondering if anyone has had any similar problems with jQuery not being backward compatible. We are starting to use it quite heavily and are thinking about upgrading to a newer version to start using several plugins that require it. Will we have any issues if we get rid of the older version?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
jQuery seems to be nicely backward compatible. I have been using it for more than a couple of years now through several versions of the core and have not had issues when upgrading except a few minor ones with some plugins. I would say that the core seems to be fine but if you're using a lot of plugins you might run into some problems (but these are usually easy to fix, or the new core has that functionality built in anyway so you can just drop them).
In my experience, jQuery 1.x has been very backwards-compatible until version 1.9.
And don't upgrade to 2.0 until you're sure that this isn't an issue for you:
jQuery has produced backwards compatibility plugins since version 1.0.
The project has the following backwards compatibility repos:
jquery-compat-1.0(Compatibility plugin for those upgrading to jQuery 1.1+ from jQuery 1.0)
jquery-compat-1.1(Compatibility plugin for those upgrading to jQuery 1.2+ from jQuery 1.1)
jquery-xpath(Implement XPath functionality for those upgrading to jQuery 1.2 from jQuery 1.1)
jquery-compat-1.3(Backwards compatibility plugin for jQuery 1.3 (to be used with jQuery 1.4))
jquery-migrate-1.x-stable(Migrate older jQuery code to jQuery 1.9+)
jquery-migrate(Migrate older jQuery code to jQuery 3.0+)
References
jQuery Blog
jQuery Wiki: Won't Fix
jQuery Core Upgrade Guides
jQuery Migrate Plugin - Warning Messages (2.0)
jQuery Migrate Plugin - Warning Messages (3.0)
jqLint
jQuery is so serious about backwards compatibility that they produce a "backwards compatibility" plugin for each release: http://docs.jquery.com/Release:jQuery_1.2#jQuery_1.1_Compatibility_Plugin. It let people who don't need backwards compatibility save on page weight.
My experience is that when upgrading, I sometimes find that stuff that used to work breaks. For instance, when upgrading from 1.7.2 to 1.8.3 I found some drag-and-drop features stopped working. Some problems may be due to deprecated jQuery functions being dropped, still in use by incompatible versions of jQuery UI.
Here is a quote from another user: