From d1a34f79081dfcfcfe851412dafd172428a6d92a Mon Sep 17 00:00:00 2001 From: John Resig Date: Fri, 23 Jan 2009 19:36:59 +0000 Subject: [PATCH] Made the getAttribute check more explicit - comment nodes don't have getAttribute in XUL documents. Fixes jQuery bug #3870. --- src/selector.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/selector.js b/src/selector.js index cf4ff9d..5425d94 100644 --- 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 = ""; - 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); }; -- 1.7.10.4