Skip to content

Instantly share code, notes, and snippets.

@terrymun
Created December 16, 2014 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrymun/df63b13461297fdb87fd to your computer and use it in GitHub Desktop.
Save terrymun/df63b13461297fdb87fd to your computer and use it in GitHub Desktop.
Better $.ajax() requests — listening to successful response
var ajaxCall = $.ajax({
context: $(element),
data: someData,
dataType: 'json',
url: '/path/to/script'
});
ajaxCall.done(function(data) {
console.log(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment