jQuery error callback on ajax call if server is down
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.
精彩评论