求倒计时5秒后自动关闭当前页面的代码

求倒计时5秒后自动关闭当前页面的代码,第1张

<html>

<title>倒计时关闭网页</title>

<head>

<script language="javascript">

<!--

function clock(){

document.title="本窗口将在"+i+"秒后close!"

if(i==0){

clearTimeout(st)

window.opener=null

window.close()}

i = i -1

st = setTimeout("clock()",1000)

}

var i=5

clock()

//-->

</script>

</head>

<body>

</body>

</html>

<script type="text/javascript">

document.ondblclick=function(){

window.opener=null

window.close()

}

</script>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6122443.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-15
下一篇 2023-03-15

发表评论

登录后才能评论

评论列表(0条)

保存