From: John Resig Date: Tue, 24 Aug 2010 14:28:47 +0000 (-0700) Subject: Make sure that missing attributes return undefined in Blackberry 4.7. Fixes #6938. X-Git-Tag: 1.4.3rc1~146 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cb40495b21bcb7802f3ab6ae0f837f2bf5b385ed;p=jquery.git Make sure that missing attributes return undefined in Blackberry 4.7. Fixes #6938. --- diff --git a/src/attributes.js b/src/attributes.js index d2fc202b2..719c368af 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -325,6 +325,12 @@ jQuery.extend({ elem.setAttribute( name, "" + value ); } + // Ensure that missing attributes return undefined + // Blackberry 4.7 returns "" from getAttribute #6938 + if ( !elem.attributes[ name ] && !elem.hasAttribute( name ) ) { + return undefined; + } + var attr = !jQuery.support.hrefNormalized && notxml && special ? // Some attributes require a special call on IE elem.getAttribute( name, 2 ) :