X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fajax.js;h=3c199af95ba7b49d00317d2f4d269194557ba081;hb=812a247dc997fa09583c0557c6173f9ec58e7d60;hp=83e5bdcaff2e10177596c58ff451b1ae4e79e476;hpb=dd45c324ecf12732185656de89b40d47e3b9d3ad;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 83e5bdc..3c199af 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -455,10 +455,11 @@ jQuery.extend({ try { var oldAbort = xhr.abort; xhr.abort = function() { - oldAbort.call( xhr ); - if ( xhr ) { - xhr.readyState = 0; + oldAbort.call( xhr ); + if ( xhr ) { + xhr.readyState = 0; + } } onreadystatechange(); @@ -477,7 +478,7 @@ jQuery.extend({ // Send the data try { - xhr.send( type === "POST" || type === "PUT" ? s.data : null ); + xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null ); } catch(e) { jQuery.handleError(s, xhr, null, e); // Fire the complete handlers @@ -664,7 +665,7 @@ jQuery.extend({ } }); - } else if ( !traditional && typeof obj === "object" ) { + } else if ( !traditional && obj != null && typeof obj === "object" ) { // Serialize object item. jQuery.each( obj, function( k, v ) { buildParams( prefix + "[" + k + "]", v );