jQuery - upgrade from version 1.6.x to 1.7
- by Renso
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 notesSummary 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")http://api.jquery.com/checked-selector/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
deprecated2. jqXHR success
and error have been deprecated3. When rendering
content with text(), white space issue cross-browsers: http://bugs.jquery.com/ticket/3144Other 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