diff options
author | John Resig <jeresig@gmail.com> | 2009-01-21 23:56:15 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-01-21 23:56:15 +0000 |
commit | 68b49cf4273ce500e2666616771e2731c6833bca (patch) | |
tree | c23940e59034d31fd772d9a0f91012ddd9c9b3fd /src/selector.js | |
parent | 58a17e6e6d57d0ba71acfcb36f7da4fcacfbeeae (diff) | |
download | jquery-68b49cf4273ce500e2666616771e2731c6833bca.tar.gz jquery-68b49cf4273ce500e2666616771e2731c6833bca.zip |
Added some additional checks to make sure that the correct methods are being used in IE on XML documents.
Diffstat (limited to 'src/selector.js')
-rw-r--r-- | src/selector.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/selector.js b/src/selector.js index 0cce515dd..6b9152daa 100644 --- a/src/selector.js +++ b/src/selector.js @@ -655,15 +655,15 @@ try { // The workaround has to do additional checks after a getElementById // Which slows things down for other browsers (hence the branching) if ( !!document.getElementById( id ) ) { - Expr.find.ID = function(match, context){ - if ( context.getElementById ) { + Expr.find.ID = function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); - return m ? m.id === match[1] || m.getAttributeNode && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; + return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function(elem, match){ - var node = elem.getAttributeNode && elem.getAttributeNode("id"); + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } |