jQuery 1.9 final, jQuery 2.0 beta, Migrate final released

Posted on by

Are you sitting down? Well sit down, in front of your computer, and start downloading. We have several new jQuery releases for you to test. For your convenience, jQuery can even be downloaded while standing.

First up are the final versions of jQuery 1.9 and jQuery Migrate 1.0. We think these releases are pretty solid, because very few of you reported any problems in the beta versions. Just be sure to read the information in the jQuery 1.9 upgrade guide so that your transition will be smoother.

Next, take out your sunglasses. Today you get a glimpse at the future, and it’s bright. jQuery 2.0 is in beta test! We know it’s a lot to take in, so let’s recap the positioning for jQuery 1.9 and 2.0:

  • jQuery 1.9 and 2.0 have the same API. Several deprecated features such as $.browser have been removed from both versions. It’s all laid out in the jQuery 1.9 upgrade guide.
  • jQuery 1.9 runs on Internet Explorer 6, 7, and 8 (“oldIE”), just like previous versions. Consider it a cleaner, slimmer, modern-API upgrade from jQuery 1.8.
  • jQuery 2.0 will not run on oldIE. As a result of removing several layers of barnacle-encrusted code, it will be both faster and smaller than jQuery 1.9.
  • The team is supporting both jQuery 1.9 and 2.0 into the future. You choose which version you want to use based on your needs.

The jQuery Migrate plugin can be used with either 1.9 or 2.0 to detect deprecated and removed features, or to restore old features for those sticky situations where you need old code to run with new jQuery. The plugin and the messages it generates are documented in the project README.

If you’re on a recent version of jQuery core and have been avoiding deprecated features, these new jQuery releases may work for your code right out of the box. (Just remember, jQuery 2.0 doesn’t work on IE 6, 7, or 8!) Still, we recommend that you always start by including the jQuery Migrate plugin to see if it gives you any warnings.

The jQuery 1.9 final files are available on jQuery’s CDN, and should be available on the Google and Microsoft CDNs within a few days:

<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.0.0.js"></script>

Or, for testing jQuery 2.0 beta 1, use the jQuery CDN:

<script src="http://code.jquery.com/jquery-2.0.0b1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.0.0.js"></script>

For diagnostic purposes, you can also include the jQuery Migrate plugin with versions of jQuery all the way back to 1.6.4 to see what changes may cause issues with your code when you finally upgrade.

No matter which version of jQuery you use with the plugin, be sure to open the browser’s console to see what warnings or errors are being generated. Warnings given by the plugin start with the word “JQMIGRATE” and are listed in the plugin’s documentation. The description explains why the warning was given and how it can be fixed.

What’s New in 1.9

It may be a few weeks before the complete documentation for this release lands at api.jquery.com, especially since the API and other documentation sites are in the process of their own upgrade. For now, here’s a summary of what’s new and changed.

Streamlined API: Many deprecated and dubious features have been removed, as documented in the upgrade guide.

New .css() multi-property getter: Now you can pass .css() an array of CSS property names and it will return an object with the current values of all those CSS properties:

var dims = $("#box").css([ "width", "height", "backgroundColor" ]);
//  { width: "10px", height: "20px", backgroundColor: "#D00DAD" }

Enhanced cross-browser CSS3 support: jQuery 1.9 now supports the following CSS3 selectors across all browsers, all the way back to IE6: :nth-last-child, :nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :target, :root, and :lang.

New .finish() method: This method can be used to immediately complete all the animations queued on an element. The jQuery 1.9 RC1 blog post has more information and an example.

Source map support: You can now run the minified version of jQuery but use source maps for debugging. This can be extremely valuable for tracking down problems on a production web site. See the jQuery 1.9 RC1 blog post for a full description.

Many, many bug fixes: We’re especially proud of what we hope will be the final set of fixes for obscure issues in IE 6, 7, and 8. See the changelog below for a complete inventory.

Getting started with 2.0

Since jQuery 2.0 has its foundation in the work for jQuery 1.9, all the discussion in the upgrade guide also applies to 2.0. The Migrate plugin will identify many of these issues for you automatically.

If you’re using jQuery in non-web-site HTML situations such as an Android, iOS, or Windows 8 app, or a Chrome/Firefox add-on, jQuery 2.0 is an awesome choice. You can even use jQuery 2.0 on web sites if you don’t support oldIE or don’t mind using conditional comments:

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

With this first beta of jQuery 2.0 we’ve made a huge down payment on major cleanup, cutting the size of the library by more than 10 percent. But we’re nowhere near done. There is more refactoring possible now that we can consistently depend on modern JavaScript, CSS, HTML, and DOM features being there. We’ll continue to tighten and clean up the code before 2.0 ships, and extend our work to make more functionality optional to shrink the size of custom builds.

They Built This For You

Many thanks to the people who have contributed to these two releases since 1.8.3 was shipped: Akintayo Akinwunmi, Alexander Farkas, Allen J Schmidt Jr, Ben Truyman, Bennett Sorbo, Callum Macrae, Carl Danley, Corey Frang, Daniel Gálvez, Dan Morgan, David Bonner, David Fox, Devin Cooper, Elijah Manor, Erick Ruiz de Chavez, Greg Lavallee, Ismail Khair, James Huston, Jay Merrifield, Jonathan Sampson, Julian Aubourg, Marcel Greter, Matt Farmer, Matthias Jäggli, Mike Petrovich, Mike Sherov, Oleg Gaidarenko, Paul Ramos, Richard Gibson, Rick Waldron, Rod Vagg, Roland Eckl, Sai Wong, Scott González, Sebi Burkhard, Timmy Willison, Timo Tijhof, Tom Fuertes, Toyama Nao, and Yi Ming He. Good work guys!

jQuery 1.9.0 final and 2.0.0 beta Changelog

Any tickets listed here that are not related to IE 6/7/8 support are also in the jQuery 2.0 beta.

Ajax

Attributes

Build

Core

Css

Data

Deferred

Effects

Event

Manipulation

Misc

Offset

Selector

Support

Traversing

63 thoughts on “jQuery 1.9 final, jQuery 2.0 beta, Migrate final released

  1. So if I were to do something like this:

    Will the Migrate plugin restore the features for “oldIE” that are removed from jQuery 2? Or do we need to use 1.9 AND the migrate plugin for oldIE?

  2. Whoops, comment system stripped out my sample instead of encoding the special characters.

    What I was asking is if you can use jQuery 2.0 and then just include the migrate plugin in and [if lt IE 9] tag and be good to go on oldIE, or if you still need to use jQuery 1.9 on oldIE regardless of whether you’re also using the migrate plugin.

  3. @Brad:
    Migrate plugin is made to ease the upgrade process; it provides warnings and changes behavior in some obscure cases. It doesn’t change which browsers are supported. If you need IE<9, use jQuery 1.9. If you don't, you can use jQuery 2.0. jQuery Migrate plugin is not necessary in both cases.

  4. 2.0 doesn’t support IE6/7/8, full stop, if I’m not mistaken. There are so many hacks needed to support them that it wasn’t feasible to do so via a plugin or anything else. But 1.9 and 2.0 are API-identical and will both be supported for the foreseeable future.

  5. IamRafi, no.

    The jQuery Migrate plugin is for warning about features that have been removed in jQuery 1.9 (and also 2.0 since it comes after 1.9). It can also *restore* those features to make a lot of older code work on 1.9/2.0. Including the plugin as advised above will help you find and fix code.

    jQuery 1.9 works on all browsers we support.

    jQuery 2.0 does not work on IE 6, 7, or 8 but otherwise should work. We may remove support for some other really old browsers but that’s the list for now.

    Since so many people don’t read well I am going to remove that incorrect summary so people won’t get confused.

  6. Minified 2.0 beta on google closure compiler and it gave 29K gzipped :(

    I was expecting 2.0 to be way lower than current release. The modules things were a disappointment too in previous release, barely reducing the size

  7. Alice Young on said:

    Unfortunately, I don’t see the 2.0 beta (unminified) code anywhere. Is it still on its way up to the code site? Or is using the git repo required?

  8. The example you shared with the .css() method:

    var dims = $(“#box”).css([ "width", "height", "backgroundColor" ]);
    // { width: “10px”, height: “20px”, backgroundColor: “#D00DAD” }

    I’m guessing it was meant to show this:
    var dims = $(“#box”).css([ "width", "height", "backgroundColor", "#D00DAD"]);

    Or else I can’t see how it would know to set the bgcolor to that hex-value

  9. @Austin,

    The new css() can now RETURN the CSS values for properties that you specify in an array. It’s just a quicker way to get a bunch of CSS values all at once. The example code is correct, yours is not.

  10. Wow, so today my website completely stopped working, and a jquery feature in put heavy in use all over the website the live() method stopped working throwing errors “uncaught typeerror object has no method ‘life'” making lots of main features broken, drove me crazy debugging it because I thought I broke it, then realized I linked my jquery directly to googleapi so it always uses latest version, after checking here and seeing a new release was made, I linked back the 1.8.3 jquery, and everything is working again! lol spent over an hour stressed before realizing this, after reading changelog I will be updating my code to use on() now that live() has been deprecated, keep up the good work guys!

  11. Can’t believe that Mobile 1.2 still calls $.browser.msie. It has long been deprecated. I’ve prepared all my code for this piece of news. Looking to upgrade when Mobile 1.3 releases.

  12. I don’t see how just 31K less makes jQuery 2 better.
    At least the IE8 code should be kept in. (just remove IE6/7)

  13. is it recomended to use 1.9 for older browsers and 2.0 for modern browsern in the same website for example with conditional comments for ie lte8 ?

  14. Zenner on said:

    Hi
    Have a site running at work with uses latest version of jquery and latest version of jquery mobile and that site stopped working yesterday and I get a “Unable to get value of the property ‘msie': object is null or undefined” and the mobile markup is not attched at all.
    If I go back to the 1.8.3 version everything works as intended.
    Quality Management gone wrong?

  15. Emmanuel on said:

    Cool finally we will have a version that get rid of the old browsers ! What a great step to the next generation of the web !!

  16. I think dropping IE8 is a bad decision. IE8 is the latest IE version available for XP. And that’s a lot of machines many of which can’t upgrade because of hardware issues (periphery, TV cards…). Now we’ll see a lot of unusable websites I am afraid.

  17. @Zenner: “Quality Management gone wrong?”
    Yep, in your team. It’s been said numerous times, including in this very article, that $.browser would get deprecated (also see jQuery Migrate). Captain Hindsight says: “If you cannot keep up with updates, stick to a specific version rather than referencing the latest one.”

  18. Mike, developers don’t have to use jQuery 2.0. Windows XP’s support ends in a little over a year anyway.

    The web shouldn’t be held back due to people that both run a soon to be unsupported OS and refused to use something like Firefox or Chrome (which jQuery 2.0 support and run on XP). If they fall into both of those camps they should expect some sites to not work.

  19. Thomas on said:

    At my sites, 47% of IE users use IE6, IE7 and IE8. So I think dropping IE7 is a bad desicion too.

  20. > I think dropping IE7 is a bad decision too.

    Where did we say we’re dropping IE7? Look above. We just released jQuery 1.9 which supports IE7!

  21. @mike, @Thomas, et al: As the post indicates, jQuery has not dropped support for IE6/7/8. It has only provided a version of jQuery for users that do not need to support those browsers. There are now 2 versions of officially-supported jQuery. One fully supports old IE (1.9.0+) and one does not (2.0.0+). Pick the one that best suits your needs.

  22. Very happy to see such a continuously updated script. Jquery has been a central part of our business for some time now as we got rid of other JS libraries, and very happy we did that. The only problem we have had is with validating secure pages with the https as some hosts don’t support this very well. Hopefully, when we upgrade to 1.9 or higher this will be solved too. Thanks and Happy New Year!

  23. Is there a JavaScript expression we can use to check if either 1.9 or 2.0 is required in the current environment?

    I guess what I’m asking is what general-purpose cross-browser code can we put in our HTML that will automatically pull in 1.9 if necessary, otherwise pull in 2.0?

    The IE conditional comments by themselves aren’t sufficient for this purpose: other browsers will not load any version of jQuery at all.

  24. @Ron Waldron, conditional comments should do that. Browsers that don’t understand CC will simply include jQuery 2.0. And really, if you have any doubts just keep your development life simple and include 1.9 everywhere.

  25. why not just release it straight to 2.0, so nobody will have problem with google CDNs with /1/ as version….

  26. Zenner on said:

    @Stifu: Read the post, the JQuery Mobile library stopped working correctly. By the way I’m not using $.browser anywhere. But thanks for your comment.

  27. @Zenner: my mistake. I still think it’s unreasonable to link to the latest version for important / stable sites, as aside from deprecated stuff and API changes, you’re never safe from regressions.

  28. CoDEmanX on said:

    The new .finish() is great, but I wished there was an option to smoothly animate to the end by a specified number of milliseconds (to final values like if queue was fully executed)

    Example (press Go, then finish button):
    http://jsfiddle.net/rwPhm/

  29. Mrjdhiphop23 on said:

    Why doesn’t my code work with this new version??

    function checkFields(){
    return ($(“#name”).attr(“value”) &&
    $(“#email”).attr(“value”));
    }

  30. @Pave, querySelectorAll doesn’t support jQuery selector extensions, and Sizzle also works around several qSA bugs. So qSA is not a drop-in replacement for Sizzle by a long shot.

  31. It is clear that the jQuery team doesn’t understand and hear the feedback that dropping oldIE is bad. Yes, there will be 1.9 support but you are clearly sending a message that your intention is to not support oldIE in the foreseeable future. If you argue that this is not the case there’s no reason to fork the code and go with two versions. I think that the perf gains and cleaner code that seems to be the goal of 2.0 is not something that most people care about anyways. At least it is not now and on the near future. May be 3-5 years from now when oldIE market share is <1% it will make sense. But right now it is a very poor decision. Your team must meet and rethink the pros and cons of this move. Consider that jQuery powers a signicant percentage of the web sites and perhaps you must exercise somewhat better judgment. in future.

  32. Leonidaz on said:

    <!– ALL BROWSERS AND IE >= IE9 WILL GET THE NEW VERSION –>
    <!–[if gte IE 9]><!–>
    <script src="//code.jquery.com/jquery-2.0.0b1.min.js" type="text/javascript"></script>
    <!–<![endif]–>

    <!– IE6-8 will get the 1.9 VERSION –>
    <!–[if lt IE 9 ]>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
    <![endif]–>

  33. Leonidaz on said:

    each dash in the html comments above should be a double dash. the commenting system stripped one.

  34. @Mark Except they haven’t dropped support for oldIE – yes, 2.0 doesn’t support it, but 2.0 and 1.9 are API-identical and will both be supported for the foreseeable future. There are plenty of situations where needing a plethora of hacks that bloat down the library and reduce performance just isn’t necessary, especially on mobile.

  35. Martijn on said:

    I don’t think now is the time to ditch IE8 just yet. We (at work) are now carefully trying to no longer support IE7, but customers may still require it, and that demand will be met. So even IE7 support is still a requirement. At any rate, IE8 is the newest IE that runs on Windows XP, an OS still heavily used among our customer base.

    Ditching IE8 is not something we can do at this point. Maybe, MAYBE, in two years or so. So if jQuery 2.0 really does NOT run on IE8, we will not be able to upgrade, which poures none but shame over the jQuery team from our point of view. Sorry to say, cause I’ve loved jQuery ever since I first met it.

  36. @Martijn
    if your customers still require IE7 why don’t you use jQuery 1.9?

    jQuery 1.9 and 2.0 have identical API, you should only update to 2.0 if you don’t need to support legacy browsers.

  37. @zenner your code updated to jQuery 1.9 which removed the depracated $.mobile. This depracated feature is used in JQM’s latest version but is fixed in JQM 1.3 which is in beta at the time.

    Automatic updates are okay at patch level, but automatically upgrading to minor versions are never a good idea.