Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added some additional checks to make sure that the correct methods ar…

…e being used in IE on XML documents.
  • Loading branch information...
commit 68b49cf4273ce500e2666616771e2731c6833bca 1 parent 58a17e6
@jeresig jeresig authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/selector.js
View
8 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;
};
}
Please sign in to comment.
Something went wrong with that request. Please try again.