Implementing Ajax in a page means implement more notifications in your page. An Ajax call is asynchronous. So when the server is down and an ajax call is made then the whole application will not respond at all. Users may think our application as dump. There are two remedies for the above problem.
1. Use Pre Defined Ajax Libraries which handles timeout feature
2 . Use Timeout Feature in your current code ( less effort )
CODE
var gotResponse=0;
var atimer;
function initAjaxCall()
{
if(!gotResponse) // Check whether the reponse has reached at this moment ..
{
alert(" Server not responding at this time .. Please try again latter ");
}
}
function makeAjaxCall()
{
atimer=setTimeout("initAjaxCall()",45000); // 45 Seconds Delay .. You can adjust this ...
ajaxCall(); // Ajax call logic will be coded in this function
}
function ajaxResponse()
{
gotResponse=1;
// Got the data in the variable data
clearTimeout(atimer);
}
}

