]> source.dussan.org Git - jquery.git/commitdiff
jQuery.ajaxSetup() data is merged with params. Fixes #10524
authorOleg <markelog@gmail.com>
Tue, 1 May 2012 18:39:45 +0000 (14:39 -0400)
committerRick Waldron waldron.rick@gmail.com <waldron.rick@gmail.com>
Tue, 1 May 2012 18:39:45 +0000 (14:39 -0400)
src/ajax.js
test/unit/ajax.js

index 3de19276625172833ee2851d426c85d64a237832..b5d4865ff3245bc7a313e9af52094e178fad264c 100644 (file)
@@ -183,7 +183,6 @@ jQuery.fn.extend({
 
                        // Otherwise, build a param string
                        } else if ( typeof params === "object" ) {
-                               params = jQuery.param( params, jQuery.ajaxSettings.traditional );
                                type = "POST";
                        }
                }
index cca72aa5c3add5bab4df184fe83a4362187e6db8..ede6d0f667f145e61316bb540b15a452dccd3856 100644 (file)
@@ -1257,6 +1257,24 @@ test("load(String, String, Function)", function() {
        });
 });
 
+asyncTest("load() - #10524", 1, function() {
+       jQuery.ajaxSetup({
+               data: { foo: "bar" }
+       });
+
+       var data = {
+               baz: 1
+       };
+
+       jQuery("#foo").load( "data/echoQuery.php", data).ajaxComplete(function( event, jqXHR, options ) {
+               ok( ~options.data.indexOf("foo=bar"), "Data from ajaxSettings was used" );
+               jQuery.ajaxSetup({
+                       data: null
+               });
+               start();
+       });
+});
+
 test("jQuery.get(String, Function) - data in ajaxSettings (#8277)", function() {
        expect(1);
        stop();
@@ -2411,4 +2429,4 @@ test("jQuery.ajax - active counter", function() {
     ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
 });
 
-}
\ No newline at end of file
+}