ASP是否可以定時觸發事件

來源:互聯網
上載者:User

其實做這個的原理是很簡單的,只是我們當時沒有仔細的去想想該怎麼實現,我這裡用的是xmlhttp來實現的,當然還有其它的辦法,我就不多說了。
現在看論壇上很多都是要一些“完整的代碼”,看了之後真的是....汗-_-!

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>

now.asp 複製代碼 代碼如下:<%
call main()
Function main()
response.write(now())
End Function
%>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.