Created
February 3, 2015 15:35
-
-
Save tomfa/091ec7b23f0af27e693d to your computer and use it in GitHub Desktop.
Basic Post request with jQuery
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
$.ajax({ | |
type: 'POST', | |
data: { | |
'datalabel1': data_1, | |
'datalabel2': data_2 | |
}, | |
url: '/where/to/post', | |
success: function(data) { | |
console.log("SUCCESS:") | |
console.log(data) | |
}, | |
error: function(data) { | |
console.log("ERROR") | |
console.log(data) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment