Anyone know what's going wrong with below code? The system will only call the getProgressMsg()
after the Ajax is completed :(
function ajax_action(action)
{
setTimeout('getProgressMsg()',2000);
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="admin.php"
url=url+"?action=admin"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function getProgressMsg()
{
xmlHttp2=GetXmlHttpObject2();
if (xmlHttp2==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url2="admin.php"
url2=url2+"?action=getMsg"
url2=url2+"&sid="+Math.random()
xmlHttp2.onreadystatechange=stateChanged2;
xmlHttp2.open("GET",url2,true);
xmlHttp2.send(null);
}