var XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
function sendAJAX()
{
XmlHttp.Open("POST","admin/UserCount.aspx",true);
XmlHttp.Send(null);
XmlHttp.onreadystatechange=ServerProcess;
}
function ServerProcess()
{
if(XmlHttp.readystate==4 || XmlHttp.readystate=='complete')
{ //document.getElementById('hidelogin').value=XmlHttp.responsetext;
var lineuser=XmlHttp.responsetext;
var retstr=lineuser.split('<');
var num=retstr[0].replace(/(^\s*)|(\s*$)/g,"");//因返回的是html,故先得到所要数据,然后入到td中,不然会变形
document.getElementById('OnlineUser').innerText="在线人数:"+num;
}
}
setInterval('sendAJAX()',500000);//5分钟一下在线总数
function sendAJAX()
{
XmlHttp.Open("POST","admin/UserCount.aspx",true);
XmlHttp.Send(null);
XmlHttp.onreadystatechange=ServerProcess;
}
function ServerProcess()
{
if(XmlHttp.readystate==4 || XmlHttp.readystate=='complete')
{ //document.getElementById('hidelogin').value=XmlHttp.responsetext;
var lineuser=XmlHttp.responsetext;
var retstr=lineuser.split('<');
var num=retstr[0].replace(/(^\s*)|(\s*$)/g,"");//因返回的是html,故先得到所要数据,然后入到td中,不然会变形
document.getElementById('OnlineUser').innerText="在线人数:"+num;
}
}
setInterval('sendAJAX()',500000);//5分钟一下在线总数