×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
1
Language: Javascript
Posted by: kallef alexandre de souza
Added: Aug 28, 2014 12:51 PM
Views: 57
Tags: $.ajax ajax
ajax jquery
  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. });
  16.