Skip to content

Instantly share code, notes, and snippets.

@jpadilla
Created November 5, 2010 16:39
Show Gist options
  • Save jpadilla/664414 to your computer and use it in GitHub Desktop.
Save jpadilla/664414 to your computer and use it in GitHub Desktop.
$.ajax({
url: '/path/to/file',
type: 'POST',
dataType: 'json',
data: {param1: 'value1'},
complete: function(xhr, textStatus) {
doSomethingOnComplete();
},
success: function(data, textStatus, xhr) {
doSomethingOnSuccess();
},
error: function(xhr, textStatus, errorThrown) {
doSomethingOnError();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment