jquery ajax: addition for #2452. Wasn't working correctly in some cases.
[jquery.git] / src / ajax.js
index 9696bb3..47e6635 100644 (file)
@@ -113,7 +113,7 @@ jQuery.extend({
        get: function( url, data, callback, type ) {
                // shift arguments if data argument was omited
                if ( jQuery.isFunction( data ) ) {
-                       type = callback;
+                       type = type || callback;
                        callback = data;
                        data = null;
                }
@@ -138,7 +138,7 @@ jQuery.extend({
        post: function( url, data, callback, type ) {
                // shift arguments if data argument was omited
                if ( jQuery.isFunction( data ) ) {
-                       type = callback;
+                       type = type || callback;
                        callback = data;
                        data = {};
                }