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();
// 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
}
});
- } 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 );