42
rated 0 times
[
48]
[
6]
/ answers: 1 / hits: 21780
/ 10 Years ago, wed, august 20, 2014, 12:00:00
I'm making an http request asynchronously using XMLHttpRequest
:
xhr.open(method, uri, true);
When I send something
:
xhr.send(something)
When the server is down, it throws the following error:
net::ERR_CONNECTION_REFUSED
How can I catch and handle this error? The standard try..catch
block doesn't work as the request is asynchronous.
Thanks in advance.
More From » html