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:
2ff3e49
)
Made the getAttribute check more explicit - comment nodes don't have getAttribute...
author
John Resig
<jeresig@gmail.com>
Fri, 23 Jan 2009 19:36:59 +0000
(19:36 +0000)
committer
John Resig
<jeresig@gmail.com>
Fri, 23 Jan 2009 19:36:59 +0000
(19:36 +0000)
src/selector.js
patch
|
blob
|
history
diff --git
a/src/selector.js
b/src/selector.js
index
cf4ff9d
..
5425d94
100644
(file)
--- a/
src/selector.js
+++ b/
src/selector.js
@@
-703,7
+703,8
@@
try {
// Check to see if an attribute returns normalized href attributes
div.innerHTML = "<a href='#'></a>";
- if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) {
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
Expr.attrHandle.href = function(elem){
return elem.getAttribute("href", 2);
};