ASP是否可以定时触发事件
程序员文章站
2023-11-29 18:00:46
其实做这个的原理是很简单的,只是我们当时没有仔细的去想想该怎么实现,我这里用的是xmlhttp来实现的,当然还有其它的办法,我就不多说了。 现在看论坛上很多都是要一些“完整...
其实做这个的原理是很简单的,只是我们当时没有仔细的去想想该怎么实现,我这里用的是xmlhttp来实现的,当然还有其它的办法,我就不多说了。
现在看论坛上很多都是要一些“完整的代码”,看了之后真的是....汗-_-!
a.html
now.asp
现在看论坛上很多都是要一些“完整的代码”,看了之后真的是....汗-_-!
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
%>