jQuery - upgrade from version 1.6.x to 1.7

Posted by Renso on Geeks with Blogs See other posts from Geeks with Blogs or by Renso
Published on Mon, 28 Nov 2011 16:04:22 GMT Indexed on 2011/11/28 18:01 UTC
Read the original article Hit count: 158

Filed under:
Goal:

Issues to consider when upgrading from jQuery version 1.6 to 1.7. This is a short list and may help identify the real issues you need to concern yourself with in stead of reading through all the release notes

Summary of issues encountered during upgrade:

As you prepare for upgrade to jQuery 1.7 from 1.6.x, this is a quick glimpse of all the issues that are relevant, not sure if it covers all but may be all you need to worry about.

Use this method only for checking checkboxes and radio buttons:
$("input:checked")
This will work regardless of the version of jQuery you are using. Note that $("input).attr("checked") returns true prior to jQuery 1.6. Only retrieve "real" attributes with "attr", in order versions it would also retrieve properties like "tagName", this no longer works with jQuery 1.6.1+

Why does $("input").attr("checked") no longer (from version 1.6.1+) return TRUE or FALSE, because if you look at the HTML (as well as W3C spec) it does not contain a true/false, but the value checked="checked", which is what it should have returned in the first place. $("input").prop("checked") works, return true, because there is in fact a DOM property for "checked" with the value being "true" or "false".

Furthermore, if you want to upgrade to jQuery 1.7 you should only have to worry about this for most part:
1. isNumeric() is new, be careful as the older version jQuery.isNaN() has been deprecated
2. jqXHR success and error have been deprecated
3. When rendering content with text(), white space issue cross-browsers: http://bugs.jquery.com/ticket/3144

Other than the issues above I am not aware of any deprecations you need to worry about.

Hope this helps to get everyone up to version 1.7

© Geeks with Blogs or respective owner