Make sure payload is sent for PUT requests. (Thanks alx). Fixes #4971.
[jquery.git] / src / core.js
index 7281b44..7e7a4e2 100644 (file)
@@ -141,7 +141,7 @@ jQuery.fn = jQuery.prototype = {
                        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
@@ -313,7 +313,9 @@ jQuery.extend({
 
        // check if an element is in a (or is an) XML document
        isXMLDoc: function( elem ) {
-               return (elem.ownerDocument || elem).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