<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
var xmlHttp;
function createXMR()
{
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function dostart()
{
createXMR();
var url="index.php";
xmlHttp.open("GET",url);
xmlHttp.onreadystatechange = callback;
xmlHttp.send(null);
setTimeout('dostart()',500);
}
/
function callback()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
document.getElementById("my").innerHTML=xmlHttp.responseText;
}
}
}
function serverstart()
{
createXMR();
var url="index.php";
xmlHttp.open("GET",url);
xmlHttp.onreadystatechange = pollcallback;
xmlHttp.send(null);
}
///
function pollcallback()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
document.getElementById("my").innerHTML=xmlHttp.responseText;
alert(xmlHttp.responseText);
serverstart();
}
}
}
</script>
</head>
<body οnlοad="dostart()">
<hr />
<div id="my"></div>
</body>
</html>