Skip to content

Instantly share code, notes, and snippets.

@tomfa
Created February 3, 2015 15:35
Show Gist options
  • Save tomfa/091ec7b23f0af27e693d to your computer and use it in GitHub Desktop.
Save tomfa/091ec7b23f0af27e693d to your computer and use it in GitHub Desktop.
Basic Post request with jQuery
$.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