mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Ajax: $.post and $.get can now take an options object
Fixes gh-1986 Closes gh-1995
This commit is contained in:
committed by
Dave Methvin
parent
bb928bde7e
commit
89ce0af2cf
@@ -796,13 +796,14 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
|
||||
data = undefined;
|
||||
}
|
||||
|
||||
return jQuery.ajax({
|
||||
// The url can be an options object (which then must have .url)
|
||||
return jQuery.ajax( jQuery.extend({
|
||||
url: url,
|
||||
type: method,
|
||||
dataType: type,
|
||||
data: data,
|
||||
success: callback
|
||||
});
|
||||
}, jQuery.isPlainObject( url ) && url ) );
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user