其实做这个的原理是很简单的,只是我们当时没有仔细的去想想该怎么实现,我这里用的是xmlhttp来实现的,当然还有其它的办法,我就不多说了。
现在看论坛上很多都是要一些“完整的代码”,看了之后真的是....汗-_-!
a.html
复制代码 代码如下:<?xmlversion="1.0"encoding="UTF-8"?>
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title>xmlhttpMission-http://www.never-online.net</title>
<metahttp-equiv="ImageToolbar"content="no"/>
<metaname="author"content="BlueDestiny,never-online"/>
<metaname="keywords"content="MozillaCSS,C#,.net,Refercence,www.never-online.net"/>
<metaname="description"content="BlueDestiny,never-online"/>
<metaname="title"content="MozillaCSSRefercenceAndDemo-http://www.never-online.net"/>
<metaname="creator.name"content="GeniusLau,never-online,blueDestiny"/>
<styletype="text/css"media="all"title="Default">
@import"main.css";
</style>
<scripttype="text/javascript">
//<![CDATA[
functionmission(){
varx=newActiveXObject("Msxml2.XMLHTTP.3.0");
x.open("get","now.asp?t="+Math.random().toFixed(4),false);
x.send();
vardemo=document.getElementById("demo");
varnow=demo.innerHTML=x.responseText;
if(now=="2006-6-2315:42:20"){
varwnd=window.open("http://blog.csdn.net/BlueDestiny","","");
};
_x=window.setTimeout(mission,1000)
}
onload=mission;
//]]>
</script>
</head>
<bodyid="www.never-online.net">
<divid="demo"></div>
</body>
</html>
now.asp
复制代码 代码如下:<%
callmain()
Functionmain()
response.write(now())
EndFunction
%>
【ASP是否可以定时触发事件】相关文章: