开发者

jQuery error callback on ajax call if server is down

开发者 https://www.devze.com 2022-12-25 06:22 出处:网络
I am using jQuery and I am making AJAX request from the many methods available to me. I am testing error callback condition and so far so good.

I am using jQuery and I am making AJAX request from the many methods available to me. I am testing error callback condition and so far so good.

If I bring the server down then firebug shows the request in RED which means it was an error开发者_如何学JAVA. However error callback is not getting called. Is this expected ? Or should jQuery's error callback should be invoked when server is disconnected.

If the expected behavior is that jQuery's error callback will not be called then how will you notify users that server is down?


You use the timeout. You don't know if the server is down, only if it doesn't respond.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号