Created
July 20, 2014 22:04
-
-
Save arthuralee/58fae58a4b7018432bef to your computer and use it in GitHub Desktop.
jQuery postJSON
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
jQuery.extend({ | |
postJSON: function(url, data, callback) { | |
return jQuery.ajax({ | |
type: "POST", | |
url: url, | |
data: JSON.stringify(data), | |
success: callback, | |
dataType: "json", | |
contentType: "application/json", | |
processData: false | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment