jQuery 2.0 Beta 3 Released

Posted on by

We’re coming down the home stretch for the release of jQuery 2.0! Today sees the release of Beta 3.

To paraphrase Dirty Harry: I know what you’re thinking. “Is Beta 3 gonna break my code?” Well, to tell you the truth, in all this excitement we may have lost track of things and introduced some bugs. So being as this is jQuery, the most powerful JavaScript library in the world, and could blow your web site clean off the Internets, you’ve got to ask yourself one question: “Do I feel lucky?” Well, do ya?

We don’t want to accidentally blow your site off the Internets; don’t count on being lucky. That means we really need your help in finding and fixing any bugs that may be hiding in the nooks and crannies of jQuery 2.0. We want to get all the problems ironed out before this version ships, and the only way to do that is to find out whether it runs with your code.

You can get this latest beta from the jQuery CDN: http://code.jquery.com/jquery-2.0.0-beta3.js

You can also use the jQuery Migrate plugin with jQuery 2.0 to restore deprecated features from those older versions and/or diagnose compatibility issues. We strongly recommend that you do use Migrate for older code, it will save a lot of time and trouble in debugging.

Staying in Sync

Remember that jQuery 2.0 will not run on IE 6, 7, or 8. You must run Internet Explorer 9 or 10 in their “modern” mode and not use the X-UA-Compatible feature, for example, to force IE10 into IE7 mode.

The jQuery team will continue to support both the jQuery 1.x and 2.x lines simultaneously for as long as those older versions of IE are still a factor. The currently released version of jQuery 1.x, which is 1.9.1, has the same API as jQuery 2.0. We are planning a 1.10 update to the 1.x line in a few months that will address any minor differences in the two versions. At that point we will still keep the two lines in sync: 1.10 and 2.0, 1.11 and 2.1, etc.

If you’d like to try jQuery 2.0 on web sites where you still need to support IE 6, 7, and 8, you can use conditional comments. All browsers except old IE will get the second script and ignore the first:

<!--[if lt IE 9]>
    <script src="jquery-1.9.1.js"></script>
<!--[if gte IE 9]><!-->
    <script src="jquery-2.0.0b3.js"></script>

Remember, however, that jQuery 1.x continues to work on all the browsers that jQuery supports.

What’s New

Here are the major changes since Beta 2:

Node.js compatibility. If the jquery.js file is included in Node via require(), it will export the jQuery object.

Windows 8 Store App compatibility. Some feature detects that were only needed for IE 6/7/8 were removed to prevent a security exception in Windows Store apps.

More bug fixes. This beta includes fixes to bugs reported since jQuery 2.0 beta 2 and jQuery 1.9.1 were shipped. The complete list is below.

Remove jQuery.support.boxModel. Nobody should be using this property since it has been deprecated since jQuery 1.3 and jQuery itself has never supported Quirks mode.

Further nips and tucks to the code. Fixing bugs often adds more bytes, but we’ve been able to actually reduce the size of the full minified/gzipped build by a couple of dozen bytes.

The wrap methods can now be excluded in a custom build. If you (and the plugins you use) aren’t calling any of the wrap methods like .wrapAll() or .unwrap(), you can leave them out of your custom build.

Custom builds under 10k bytes! If you’re able to exclude all the optional modules, you’ll be rewarded with a custom build that’s only 9,226 bytes when minified and gzipped. See the beta 2 blog post for more information on how to do custom builds.

The full list of commits is available on GitHub and the closed bug tickets are below. Many thanks to Rick Waldron, Michal Golebiowski, Li Xudong, Timmy Willison, Nguyen Phuc Lam, Steven Benner, Tom Fuertes, Richard Gibson, Scott González, and Oleg Gaidarenko for their efforts on this beta.












11 thoughts on “jQuery 2.0 Beta 3 Released

  1. “Node.js compatibility. If the jquery.js file is included in Node via require(), it will export the jQuery object.”

    Do we get an official jQuery package to npm then? Browserify users would love it.

  2. Hi,
    Is the Windows 8 App Store compatibility complete?
    I hope not, because I’ve still got a security exception on an app that’s working with appendTo’s 1.8.1-win8 version, due to some KnockOutJS code…?!
    I haven’t been debugging it to see due to which binding is it failing exactly yet, but I had lot of code that did stuff like conditional text and property binding, which at some point incurs an append(Child) with a security exception throw. :(

  3. @dada, please open a ticket at bugs.jquery.com with a simple test case that we can debug. Bugs should not be reported here.