mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
jQuery.ajaxSetup() data is merged with params. Fixes #10524
This commit is contained in:
parent
dc3c983be0
commit
6bed348a00
@ -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";
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user