views:

31

answers:

1

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. 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?

+1  A: 

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

Byron Whitlock
timeout is working only when the server is alive. If the server is alive and I set timeout to 1000 then I get error. HOwever if I set timeout to 8000 and if I kill server then I do not get any error. This is with jquery.1.4.2
Nadal