If you are planning to develop a dynamic website jQuery can be one of the best tools for your needs. The team behind jQuery recently launched version 2.0 that is expected to aid developers and make their job easy. Also there are some chances that might put the developers in a tight spot. This is perhaps many developers aren’t jumping into jQuery 2.0 immediately. We shall take a peek at some of these changes in our short write-up.
No Support for IE 6/7/8
To start with jQuery 2.0 will offer no support for IE 6/7/8 and even IE9 and IE10 if they are used in the ‘Compatibility View’ mode. Abandoning IE8 is being considered as premature by many developers due to the number of users who are still making use of this browser. In the latest release jQuery has done away with legacy IE code for node selection. It has also removed the code for DOM manipulation, event handling and Ajax. Doing so it has reduced the file size considerably making websites faster even on dial-up connections.
Major Bug Fixes
In the latest version jQuery many of the existing bugs have been fixed. It will also carry forward all the major fixes from jQuery 1.9.1 and 1.9.2. Some of the optimizations that aren’t supported by older versions of WebKit such as Android 2.3 have been omitted in the new version to make it more stable.
New .data() Implementation
Many developers had for long been complained about the .data() implementation and this this has been worked out well in the new version. The new code has been written afresh and it is smaller, simpler, and much more maintainable than the old code. This development is expected to bring smile on the faces of the developers.
One of the major improvements in JQuery 2.02 has been in the custom build feature. This has been refined in version and allows you to exclude any or all of the 12 unused modules completely or partially and shrink jQuery below 10Kb. The modules which you can omit include ajax, ajax/xhr, ajax/script, css, dimensions, effects, event-alias, offset, wrap and sizzle.
Minimal Selector Engine
A small wrapper around the browser’s native querySelectorAll and matchesSelector APIs has been created. This can easily be used as a replacement for the full-fledged Sizzle selector engine. This will reduce the impact of the Selector Engine on your website. However you need to keep in mind that there are major differences in the supported selectors and semantics. jQuery selector extensions like :radio or :first for example aren’t supported in the minimal Selector Engine.
Should You Make The Switch?
This is one of the questions that would come to your mind as the new development in jQuery library has its pros as well as some cons. The developers of jQuery library wanted to make 2.0 and 1.9 interchangeable in order to make the switch from 1.x series to the newer 2.x series smooth. One of the ways to come to a decision would be to judge the importance 0f IE 6/7/8 in your website. If you need that stay with 1.9 or else make the transition.