Skip to content

Instantly share code, notes, and snippets.

@luckyshot
Created September 30, 2013 00:01
Show Gist options
  • Save luckyshot/6757674 to your computer and use it in GitHub Desktop.
Save luckyshot/6757674 to your computer and use it in GitHub Desktop.
jQuery AJAX Requests
$.ajax({
type: "POST",
url: "some.php",
data: { name: "John", location: "Boston" }
})
.done(function( data ) {
data = $.parseJSON(data);
console.log(data);
})
.fail(function( jqXHR, textStatus ) {
console.log(textStatus);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment