Skip to content

Instantly share code, notes, and snippets.

@cmarkle27
Created August 4, 2012 01:20
Show Gist options
  • Save cmarkle27/3253280 to your computer and use it in GitHub Desktop.
Save cmarkle27/3253280 to your computer and use it in GitHub Desktop.
jQuery Ajax using defereds
var request = $.ajax({
url: "/url",
type: "POST",
data: {"id" : 0},
dataType: "html"
});
request.done(function(msg) {
console.log(msg);
});
request.fail(function(jqXHR, textStatus) {
console.error("Request failed: " + textStatus, jqXHR);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment