Created
February 3, 2010 08:17
-
-
Save pcdinh/293470 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _ajax_request(url, data, callback, type, method) { | |
if (jQuery.isFunction(data)) { | |
callback = data; | |
data = {}; | |
} | |
return jQuery.ajax({ | |
type: method, | |
url: url, | |
data: data, | |
success: callback, | |
dataType: type | |
}); | |
} | |
jQuery.extend({ | |
put: function(url, data, callback, type) { | |
return _ajax_request(url, data, callback, type, 'PUT'); | |
}, | |
delete_: function(url, data, callback, type) { | |
return _ajax_request(url, data, callback, type, 'DELETE'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment