jquery ajax: closes #2452. get() and post() weren't shifting all arguments correctly.

This commit is contained in:
Ariel Flesler 2009-09-15 15:28:28 +00:00
parent 183f37e4b4
commit 5b9214e7d8

View file

@ -111,8 +111,9 @@ jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".sp
jQuery.extend({ jQuery.extend({
get: function( url, data, callback, type ) { get: function( url, data, callback, type ) {
// shift arguments if data argument was ommited // shift arguments if data argument was omited
if ( jQuery.isFunction( data ) ) { if ( jQuery.isFunction( data ) ) {
type = callback;
callback = data; callback = data;
data = null; data = null;
} }
@ -135,7 +136,9 @@ jQuery.extend({
}, },
post: function( url, data, callback, type ) { post: function( url, data, callback, type ) {
// shift arguments if data argument was omited
if ( jQuery.isFunction( data ) ) { if ( jQuery.isFunction( data ) ) {
type = callback;
callback = data; callback = data;
data = {}; data = {};
} }