return this.length;
},
- toArray: slice,
+ toArray: function(){
+ return slice.call( this, 0 );
+ },
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
this.toArray() :
// Return just the object
- ( num < 0 ? this.toArray(num)[ 0 ] : this[ num ] );
+ ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// check if an element is in a (or is an) XML document
isXMLDoc: function( elem ) {
- return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
- !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ return ((elem.ownerDocument || elem).documentElement || 0).nodeName !== "HTML";
},
// Evalulates a script in a global context