AJAX+ASP交互的实例

来源:互联网 发布:诺基亚下载软件网址 编辑:程序博客网 时间:2024/05/16 08:45

客户端:gettime.htm
<html>
<body  onLoad=getClock();>
<SPAN id=time_area></SPAN>
</body>
</html>
<script language="javascript">
function getClock()
{
 var XmlHttp = new ActiveXObject("Msxml2.XMLHTTP")
 XmlHttp.Open( "POST","clock.asp", false );
 XmlHttp.Send();
   if (XmlHttp.status == 200) document.getElementById("time_area").innerHTML = XmlHttp.responseText;
  window.setTimeout("getClock()","1000")
}
</script>

 

clock.asp
<%
Response.Write now()
%>

 
原创粉丝点击