Reload the page, when AJAX engine processes the server response late?

Hi all,
I have a page like this,
Design New Cable

In this page, i have displayed a select box at the time of loading the page…
When a user selects any item from this select box, the AJAX engine calls on the select box, the second select box will be displaying based on the selection.

Now, if the time to load the new select box after selecting the previous select box is more (means when AJAX engine processes the server is taking more time to display the response), i want to display a message or reload the entire page (if network is properly connected) otherwise (if network connection fails, at that time) it will simply display the network connection failed message…

How to do this…
Give me some example to do this…

Thanking you…

You are using jQuery, so you can use its built in function. Add “timeout” parameter to jQuery’s ajax request and event to handle errors, then in that event show message. Something like this:

$.ajax({
 .. your usual parameters ...
 'timeout': 20000, /* 20 seconds */
 'error': function(XMLHttpRequest, textStatus, errorThrown) {
    if(textStatus == 'timeout') 
    {
        .... show your timeout message here ...
    }
  }
});

Thank you for your reply…
Where should i add this code…
I dont know much about Ajax and JQuery…

Is there any other way to do it…
Help me to solve this problem…

Thanking you…