juliocavalcanti

jQuery - Ajax Snippet

Sep 11th, 2013 (edited)
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.36 KB | None | 0 0
  1. $.ajax({
  2.     url: '/path/to/file',
  3.     type: 'default GET (Other values: POST)',
  4.     dataType: 'default: Intelligent Guess (Other values: xml, json, script, or html)',
  5.     data: {param1: 'value1'},
  6. })
  7. .done(function() {
  8.     console.log("success");
  9. })
  10. .fail(function() {
  11.     console.log("error");
  12. })
  13. .always(function() {
  14.     console.log("complete");
  15. });
Advertisement
Add Comment
Please, Sign In to add comment