X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fattributes.js;h=719c368af9f14e168d735a7ede4f3683a23d80fa;hb=7f18d29287aad960fda58b29e3362c9323fc23db;hp=d2fc202b2fb7b50fd1d33be4bc9163b3bc84e0aa;hpb=392174431af1c9abc94ab6bd1c14f9f8f92a2a7d;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index d2fc202..719c368 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 ) :