From 5b9214e7d8db9759471dd95822a207a8653b48a3 Mon Sep 17 00:00:00 2001 From: Ariel Flesler Date: Tue, 15 Sep 2009 15:28:28 +0000 Subject: [PATCH] jquery ajax: closes #2452. get() and post() weren't shifting all arguments correctly. --- src/ajax.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ajax.js b/src/ajax.js index f8ac52e..9696bb3 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -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 = {}; } -- 1.7.10.4