Created
February 10, 2017 06:16
-
-
Save diewland/d254ff3237a55776fea05a93a7b017b2 to your computer and use it in GitHub Desktop.
How to post json via jquery ajax ?
This file contains hidden or 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 jsonPost(url, data, callback){ | |
$.ajax({ | |
'url': url, | |
'type': 'post', | |
'contentType': 'application/json; charset=utf-8', | |
'dataType': 'json', | |
'data': JSON.stringify(data), | |
'success': function(a, b, c){ | |
callback(a, b, c); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment