if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
- params = null;
+ params = undefined;
// Otherwise, build a param string
} else if ( typeof params === "object" ) {
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
- data = null;
+ data = undefined;
}
return jQuery.ajax({
jQuery.extend({
getScript: function( url, callback ) {
- return jQuery.get( url, null, callback, "script" );
+ return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
});
});
+test("jQuery.get(String, Function) - data in ajaxSettings (#8277)", function() {
+ expect(1);
+ stop();
+ jQuery.ajaxSetup({
+ data: "helloworld"
+ });
+ jQuery.get(url('data/echoQuery.php'), function(data) {
+ ok( /helloworld$/.test( data ), 'Data from ajaxSettings was used');
+ jQuery.ajaxSetup({
+ data: null
+ });
+ start();
+ });
+});
+
test("jQuery.get(String, Hash, Function) - parse xml and use text() on nodes", function() {
expect(2);
stop();