git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1bdcffb
)
Make sure that missing attributes return undefined in Blackberry 4.7. Fixes #6938.
author
John Resig
<jeresig@gmail.com>
Tue, 24 Aug 2010 14:28:47 +0000
(07:28 -0700)
committer
John Resig
<jeresig@gmail.com>
Tue, 24 Aug 2010 14:28:47 +0000
(07:28 -0700)
src/attributes.js
patch
|
blob
|
history
diff --git
a/src/attributes.js
b/src/attributes.js
index
d2fc202
..
719c368
100644
(file)
--- 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 ) :