Skip to content
Permalink
Browse files

Made the getAttribute check more explicit - comment nodes don't have …

…getAttribute in XUL documents. Fixes jQuery bug #3870.
  • Loading branch information...
jeresig committed Jan 23, 2009
1 parent 2ff3e49 commit d1a34f79081dfcfcfe851412dafd172428a6d92a
Showing with 2 additions and 1 deletion.
  1. +2 −1 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);
};

0 comments on commit d1a34f7

Please sign in to comment.
You can’t perform that action at this time.