jquery ajax: closes #2452. get() and post() weren't shifting all arguments correctly.
authorAriel Flesler <aflesler@gmail.com>
Tue, 15 Sep 2009 15:28:28 +0000 (15:28 +0000)
committerAriel Flesler <aflesler@gmail.com>
Tue, 15 Sep 2009 15:28:28 +0000 (15:28 +0000)
src/ajax.js

index f8ac52e..9696bb3 100644 (file)
@@ -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 = {};
                }