Created
September 11, 2015 08:03
-
-
Save vihoangson/c15378047495b25fc22c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: '/path/to/file', | |
type: 'default GET (Other values: POST)', | |
dataType: 'default: Intelligent Guess (Other values: xml, json, script, or html)', | |
data: {param1: 'value1'}, | |
beforeSend: function (){ | |
this_s.after(" <img src='img/loading.gif' class='loading_ajax'> "); | |
} | |
}) | |
.done(function() { | |
$(".loading_ajax").remove(); | |
console.log("success"); | |
}) | |
.fail(function() { | |
console.log("error"); | |
}) | |
.always(function() { | |
console.log("complete"); | |
}); |
Author
vihoangson
commented
Sep 14, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment