Skip to content

Instantly share code, notes, and snippets.

@DawTaylor
Created November 24, 2016 01:14
Show Gist options
  • Save DawTaylor/14e2160fbb27b27ca4bc4ed9d62e77aa to your computer and use it in GitHub Desktop.
Save DawTaylor/14e2160fbb27b27ca4bc4ed9d62e77aa to your computer and use it in GitHub Desktop.
Simple Ajax Post Data
$.ajax({
url : 'handlerURL',
type : 'POST', //Cloud be GET/PUT/DELETE/PATCH
data : $(form).serialize(), // could be { foo : 'bar', bar : 'foo' }
success : function(data){
//Do something with success data
},
error : function(error){
//Do something with error data
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment