From f8b00051c377360f0106e56c24df1353aaf6ad44 Mon Sep 17 00:00:00 2001 From: John Resig Date: Wed, 25 Jul 2007 00:56:50 +0000 Subject: $("#foo", xml) would always return an empty set, fixed (bug #877). Additionally, a bug in jQuery.isXMLDoc(xmlDoc) was discovered, if the element was, in fact, an XML document. --- src/selector/selector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/selector') diff --git a/src/selector/selector.js b/src/selector/selector.js index 2cf0b6404..366cf3188 100644 --- a/src/selector/selector.js +++ b/src/selector/selector.js @@ -213,7 +213,7 @@ jQuery.extend({ var elem = ret[ret.length-1]; // Try to do a global search by ID, where we can - if ( m[1] == "#" && elem && elem.getElementById ) { + if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) { // Optimization for HTML document case var oid = elem.getElementById(m[2]); -- cgit v1.2.3