JS计时器自动跳变问题
- 提问者网友:川水往事
- 2021-01-31 23:06
只是原码
- 五星知识达人网友:轮獄道
- 2021-01-31 23:27
把start()函数加入到setTm()里的尾部
- 1楼网友:青灯有味
- 2021-02-01 00:10
我觉得你写复杂了,给你看个例子:
a.html相当于你的主页面,b.html就相当于你的登陆页面
=================
a.html
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" " http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns=" http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head>
<body> <input type="button" value="打开新窗口" onclick="opennew()" /> <script type="text/javascript"> function opennew(){ window.open("b.html","newwindow","width=557,height=176,top=10,left=20"); } </script> </body> </html> ===========================
b.html
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" " http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns=" http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head>
<body onload="window.settimeout('window.close()',3000)"> 该窗口将在3秒内关闭 </body> </html>