From cb40495b21bcb7802f3ab6ae0f837f2bf5b385ed Mon Sep 17 00:00:00 2001 From: John Resig Date: Tue, 24 Aug 2010 07:28:47 -0700 Subject: [PATCH] Make sure that missing attributes return undefined in Blackberry 4.7. Fixes #6938. --- src/attributes.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 ) : -- 1.7.10.4