I can't find the documentation on what are the parameters for the always()
method.
Right now, I'm just using:
$.post("foo.do", {
...
}, function(data) {
...
}).fail(function(jqXHR, textStatus, errorThrown) {
...
}).always(function() {
...
});
I can't find the documentation on what are the parameters for the always()
method.
Right now, I'm just using:
$.post("foo.do", {
...
}, function(data) {
...
}).fail(function(jqXHR, textStatus, errorThrown) {
...
}).always(function() {
...
});
Share
Improve this question
edited Oct 11, 2014 at 19:15
Mike
24.5k14 gold badges83 silver badges93 bronze badges
asked Oct 11, 2014 at 18:59
Paul VargasPaul Vargas
42.1k16 gold badges107 silver badges148 bronze badges
1
-
See also api.jquery./jquery.ajax
jqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown ) { });
– Mike Commented Oct 11, 2014 at 19:01
1 Answer
Reset to default 7The documentation is in jqXHR section of the $.ajax entry. 1
The parameters are as follows:
jqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown ) { });
If an error occurred:
jqXHR.always(function( jqXHR, textStatus, errorThrown ) { });
And otherwise:
jqXHR.always(function( data, textStatus, jqXHR ) { });
Notes
- Thanks to Mike's ment.