我做了一个网页,怎么样才能让它经过一定时间(比如30秒)后自动关闭呀?
谢谢!
<html> <head> <script language="JavaScript"> //Written By Griefforyou. //2004-12-03 var timeout=30; function CloseWindow(){ if(timeout==0) document.getElementById("WebBrowser").ExecWB(45,1); else { timeout--; document.getElementById("time").innerText=timeout; } setTimeout("CloseWindow()",1000) } </script> </head> <body onload="javascript:CloseWindow()"> 该页将在<span id=time> </span>秒后自动关闭 <object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object> </body> </html>