jQuery Migrate 1.1.1 Released

Posted on by

To magnify your jQuery migration pleasure, version 1.1.1 of the jQuery Migrate plugin is now available. This plugin can greatly simplify the process of moving older jQuery code to version 1.9.0 or higher of jQuery by identifying deprecated features. It can also restore those features so that older code can run without needing any changes at all. We strongly recommend that you use this plugin in your initial jQuery 1.9 upgrade — make it easy on yourself, that’s why we wrote this plugin!

If you haven’t yet read about jQuery 1.9 and the Migrate plugin, we recommend that you check out the jQuery 1.9 upgrade guide and the original jQuery 1.9 blog post.

Using the plugin is easy; just include it immediately after the script tag for jQuery, for example.

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

For more information, see the jQuery Migrate documentation.

Here are the items we’ve polished for this version; you can see the complete list at Github. Many thanks to jQuery team member Richard Gibson for his help on this release.

  • Remove “use strict”: Not all code is compatible with JavaScript’s “use strict” mode, so we’ve removed this restriction for the same reason we did in jQuery 1.9.1. This fixes some issues with diagnostic software that uses arguments.caller and with form processing in ASP.NET.
  • $.parseJSON in $.ajax: In 1.9 when an $.ajax() call specifies a dataType: "json" the returned value MUST be valid JSON. Older versions treated an empty string as a success even though it was not valid JSON. The Migrate plugin will now warn about this, treat the result as success and return null as older versions did.
  • Preserve custom $.browser: If the $.browser object has been changed or augmented by code that loaded before jQuery Migrate, those changes will now be preserved. However, we still advise the Migrate plugin be loaded immediately after the jQuery core file.

Happy upgrading!

4 thoughts on “jQuery Migrate 1.1.1 Released

  1. crazy888s on said:

    Ha I wish we had already migrated. We’re upgrading from jquery 1.4.4 in some cases. This plugin and guide will be critical to us. Thanks

  2. Brian G on said:

    It’s great to use feature detection, but sometimes there is no feature to detect. For instance, if you are trying to distinguish the difference between:

    1) a click
    2) obtaining focus via tab
    3) a “click” on a radio done with spacebar

    Good luck with that. I was hoping that jQuery would have handled this by now, but it hasn’t.

  3. Billy Corgan on said:

    $.browser is an imperative feature in jquery, the removal of which triggers errors in lots of widely used libraries, two of which I use:

    jquery easy ui
    jquery placeholder

  4. This is an admittance of failure. To have to extend jQuery with a plugin to “assist migration” effectively renders the migration void.

    Case in point: jQuery UI 1.9+ breaks “without migrate”. This is even more of a catastrophe than the deprecation of “live”, which has impacted thousands of websites.