The jQuery.ajax()
function I use works correctly most of the time. However sometimes it is not returning any data. Instead the error()
function is called.
$.ajax({
[...]
, error: function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
}
});
I can see in there that in those cases textStatus
is 'error'
and errorThrown
is ''
(empty).
The jQuery documentation just lists the possible values of textStatus
("timeout"
, "error"
, "abort"
, and "parsererror"
). However it does not describe, what 'error'
means.
jqXHR
returns an object but it does not seam to reveal any additional insights.
How can I investigate what the source to this issue is?
Found out it happens, whenever Reload is pressed in the browser, while the ajax request was still running.
This post helped me implement a solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With