无操作定时关闭页面
<script> var x = true; var i = 0 ; function test1(){ i=i+1; x=true; } function test(){ setTimeout("test()",1000); if(x==false){ document.getElementById("closeWindow").click(); } x=false; } test(); </script> <body onmousemove="test1();"> <a id="closeWindow" href="/" onClick="javascript:window.close();return false;"></a> <a href="/" onClick="javascript:window.close();return false;">关闭窗口</a> </body>