Commit 6bed348a authored by Oleg's avatar Oleg Committed by Rick Waldron waldron.rick@gmail.com

jQuery.ajaxSetup() data is merged with params. Fixes #10524

parent dc3c983b
...@@ -183,7 +183,6 @@ jQuery.fn.extend({ ...@@ -183,7 +183,6 @@ jQuery.fn.extend({
// Otherwise, build a param string // Otherwise, build a param string
} else if ( typeof params === "object" ) { } else if ( typeof params === "object" ) {
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
type = "POST"; type = "POST";
} }
} }
......
...@@ -1257,6 +1257,24 @@ test("load(String, String, Function)", function() { ...@@ -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() { test("jQuery.get(String, Function) - data in ajaxSettings (#8277)", function() {
expect(1); expect(1);
stop(); stop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment