Как я могу отслеживать время ожидания AJAX в следующей простой функции AJAX
function process()
{
document.getElementById('message').innerHTML='Loading..';
var ajaxRequest; // The variable that makes Ajax possible
try
{
ajaxRequest = new XMLHttpRequest();
}
catch (e)
{
try
{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
ajaxRequest.onreadystatechange = function()
{
if(ajaxRequest.readyState == 4)
{
var ajaxDisplay = document.getElementById('message');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
var query;
query="process.php?action=delete";
ajaxRequest.open("POST", query, true);
ajaxRequest.send(null);
}