Skip to main content

Bug Tracker

Side navigation

Ticket #2452: argshift.diff
File argshift.diff, 0.6 KB (added by nathanhammond, August 14, 2008 05:07AM UTC)

Makes sure the argument shift is complete.

Index: jquery/src/ajax.js
===================================================================
--- jquery/src/ajax.js	(revision 5828)
+++ jquery/src/ajax.js	(working copy)
@@ -99,6 +99,7 @@
 	get: function( url, data, callback, type ) {
 		// shift arguments if data argument was ommited
 		if ( jQuery.isFunction( data ) ) {
+			type = callback;
 			callback = data;
 			data = null;
 		}
@@ -121,7 +122,9 @@
 	},
 
 	post: function( url, data, callback, type ) {
+		// shift arguments if data argument was ommited
 		if ( jQuery.isFunction( data ) ) {
+			type = callback;
 			callback = data;
 			data = {};
 		}

Download in other formats:

Original Format