In fact, the principle of doing this is very simple, but we didn't think about how to implement it at that time. I used xmlhttp to implement it. Of course, there are other methods, so I won't say much.
Now, many of the forums need some "complete code". After reading it, I really... Sweat-_-!
a.html
The code copy is as follows: <?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,Reference,www.never-online.net"/>
<metaname="description"content="BlueDestiny,never-online"/>
<metaname="title"content="MozillaCSSReferenceAndDemo-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
Copy the code as follows: <%
callmain()
Functionmain()
response.write(now())
EndFunction
%>