Only do the hasAttribute check if the method exists - IE falls back to the === null check below which allows this to still work. Follow-up to cb40495b21 - thanks to @jitter for the catch.

This commit is contained in:
jeresig 2010-09-27 09:19:21 -04:00
parent 157a383dae
commit a384d840d6

View file

@ -332,7 +332,7 @@ jQuery.extend({
// Ensure that missing attributes return undefined
// Blackberry 4.7 returns "" from getAttribute #6938
if ( !elem.attributes[ name ] && !elem.hasAttribute( name ) ) {
if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
return undefined;
}