Here are some
highlights of the changes that jQuery 2.0 brings:
- No more support for IE 6/7/8 : Remember that this can also affect IE9 and even IE10 if they are used in their “Compatibility View” modes that emulate older versions. To prevent these newer IE versions from slipping back into prehistoric modes, you have always use an X-UA-Compatible tag or HTTP header. If you can use the HTTP header it is slightly better for performance because it avoids a potential browser parser restart.
- Reduced size: The final 2.0.0 file is 12 percent smaller than the 1.9.1 file. You can now exclude combinations of 12 different modules to create a custom version that is even smaller.
- Custom builds for even
smaller files: This
feature has been greatly refined and extended since its debut in
jQuery 1.8. A new minimal selector engine, basically a thin wrapper
around the browser’s
querySelectorAll
API, lets you shrink the build to less than 10KB when minified and gzipped.
- jQuery 1.9 API equivalence: jQuery 2.0 is API-compatible with 1.9, which means that all of the changes documented in the jQuery 1.9 Upgrade Guide have been applied to jQuery 2.0 as well. If you haven’t yet upgraded to jQuery 1.9, you may want to try that first. Be sure to use the jQuery Migrate plugin.
How
to Use It
jQuery 2.0 is intended for the
modern web; we’ve got jQuery 1.x to handle older browsers and fully
expect to support it for several more years. If you want, you can
serve 2.0 to newer browsers and 1.9 to older ones using our
conditional comment trick, but that is not
required. The simplest way to support older browsers is to use jQuery
1.x on your site, since it works for all browsers.
With the release of jQuery
2.0, there are a few environments where the jQuery will no longer
support use of the 1.x line because 2.x is a far better choice. These
are typically non-web-site scenarios where support for older IE isn’t
relevant. They include:
- Google Chrome add-ons
- Mozilla XUL apps and Firefox extensions
- Firefox OS apps
- Chrome OS apps
- Windows 8 Store (“Modern/Metro UI”) apps
- BlackBerry 10 WebWorks apps
- PhoneGap/Cordova apps
- Apple UIWebView class
- Microsoft WebBrowser control
- node.js (combined with jsdom or similar)