mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
jquery ajax: closes #2452. get() and post() weren't shifting all arguments correctly.
This commit is contained in:
@@ -111,8 +111,9 @@ jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".sp
|
||||
jQuery.extend({
|
||||
|
||||
get: function( url, data, callback, type ) {
|
||||
// shift arguments if data argument was ommited
|
||||
// shift arguments if data argument was omited
|
||||
if ( jQuery.isFunction( data ) ) {
|
||||
type = callback;
|
||||
callback = data;
|
||||
data = null;
|
||||
}
|
||||
@@ -135,7 +136,9 @@ jQuery.extend({
|
||||
},
|
||||
|
||||
post: function( url, data, callback, type ) {
|
||||
// shift arguments if data argument was omited
|
||||
if ( jQuery.isFunction( data ) ) {
|
||||
type = callback;
|
||||
callback = data;
|
||||
data = {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user