X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=3f4f732bd30a2aaaa3c45e172b7741e9a3843fb8;hb=1f92edee207829a28de80ee72548cdbd599bcc79;hp=ceeef5eb4b8563571381ee027bc130e0fc7679a5;hpb=ab3ba4a81252c4357a7aab5f24d765d41d47986e;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index ceeef5e..3f4f732 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -343,7 +343,9 @@ function buildParams( prefix, obj, traditional, add ) { }); } else if ( !traditional && obj != null && typeof obj === "object" ) { - if ( jQuery.isEmptyObject( obj ) ) { + // If we see an array here, it is empty and should be treated as an empty + // object + if ( jQuery.isArray( obj ) || jQuery.isEmptyObject( obj ) ) { add( prefix, "" ); // Serialize object item. @@ -401,4 +403,4 @@ jQuery.support.ajax = !!testXHR; // Does this browser support crossDomain XHR requests jQuery.support.cors = testXHR && "withCredentials" in testXHR; -})(jQuery); \ No newline at end of file +})( jQuery );