|
1、两个html文件,一个是定时程序,另一个在时间到时被打开。
2、MyHtml.html 定时器主程序,运行效果如下:

其中,文本框内输入多少秒后打开新页面。点 do 按钮开始计时。
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>MyHtml.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> </head> <body> <form action="" name="form1"> <input type="text" name="miao" style="width: 50px"><input type="button" value="do" > </form> </body> <script type="text/javascript"> function doone() { window.open("show.htm"); } function begin() { var num=form1.miao.value * 1000 ; setTimeout("doone()",num) } </script></html>
3、show.htm 在时间点到时被打开,起到提醒作用
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>show.htm</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> </head> <body> This time is shoud to get some ... <br> </body></html>
程序见附件。 |
|