ASP是否可以定時觸發(fā)事件
更新時間:2007年01月09日 00:00:00 作者:
其實做這個的原理是很簡單的,只是我們當時沒有仔細的去想想該怎么實現(xiàn),我這里用的是xmlhttp來實現(xiàn)的,當然還有其它的辦法,我就不多說了。
現(xiàn)在看論壇上很多都是要一些“完整的代碼”,看了之后真的是....汗-_-!
a.html
now.asp
現(xiàn)在看論壇上很多都是要一些“完整的代碼”,看了之后真的是....汗-_-!
a.html
復制代碼 代碼如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> xmlhttpMission - http://www.never-online.net </title>
<meta http-equiv="ImageToolbar" content="no" />
<meta name="author" content="BlueDestiny, never-online"/>
<meta name="keywords" content="Mozilla CSS, C#, .net, Refercence, www.never-online.net"/>
<meta name="description" content="BlueDestiny, never-online"/>
<meta name="title" content="Mozilla CSS Refercence And Demo - http://www.never-online.net" />
<meta name="creator.name" content="Genius Lau, never-online, blueDestiny" />
<style type="text/css" media="all" title="Default">
@import "main.css";
</style>
<script type="text/javascript">
//<![CDATA[
function mission() {
var x = new ActiveXObject("Msxml2.XMLHTTP.3.0");
x.open("get","now.asp?t="+Math.random().toFixed(4),false);
x.send();
var demo = document.getElementById("demo");
var now = demo.innerHTML = x.responseText;
if(now == "2006-6-23 15:42:20") {
var wnd = window.open("http://blog.csdn.net/BlueDestiny","","");
};
_x = window.setTimeout(mission,1000)
}
onload = mission;
//]]>
</script>
</head>
<body id="www.never-online.net">
<div id="demo"></div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> xmlhttpMission - http://www.never-online.net </title>
<meta http-equiv="ImageToolbar" content="no" />
<meta name="author" content="BlueDestiny, never-online"/>
<meta name="keywords" content="Mozilla CSS, C#, .net, Refercence, www.never-online.net"/>
<meta name="description" content="BlueDestiny, never-online"/>
<meta name="title" content="Mozilla CSS Refercence And Demo - http://www.never-online.net" />
<meta name="creator.name" content="Genius Lau, never-online, blueDestiny" />
<style type="text/css" media="all" title="Default">
@import "main.css";
</style>
<script type="text/javascript">
//<![CDATA[
function mission() {
var x = new ActiveXObject("Msxml2.XMLHTTP.3.0");
x.open("get","now.asp?t="+Math.random().toFixed(4),false);
x.send();
var demo = document.getElementById("demo");
var now = demo.innerHTML = x.responseText;
if(now == "2006-6-23 15:42:20") {
var wnd = window.open("http://blog.csdn.net/BlueDestiny","","");
};
_x = window.setTimeout(mission,1000)
}
onload = mission;
//]]>
</script>
</head>
<body id="www.never-online.net">
<div id="demo"></div>
</body>
</html>
now.asp
復制代碼 代碼如下:
<%
call main()
Function main()
response.write(now())
End Function
%>
call main()
Function main()
response.write(now())
End Function
%>
相關文章
談動態(tài)多行多列,循環(huán)行和列,輸出M行N列的ASP代碼
2008-03-03msxml3.dll 錯誤 800c0019 系統(tǒng)錯誤:-2146697191解決方法
今天發(fā)現(xiàn)一個asp后臺使用了XMLHTTP組件的頁面無法無法生成靜態(tài)頁面了,運行時提示msxml3.dll 錯誤 800c0019 系統(tǒng)錯誤:-2146697191,經過搜索如下方法解決了問題2020-11-11