為啥我的秒不走
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對(duì)象</title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? <!--先編寫好網(wǎng)頁布局-->
? <h1>操作成功<br/></h1>
? <script type="text/javascript">??
??
?function jishi(){
? ? window.open("http://idcbgp.cn/code/1633")
?}
? ? y=setTimeout("jishi()",1000*5)
? ??
? ??
? ??
? ?function daojishi(){?
? ? y=document.getElementById("seconds1").innerHTML
? ? //獲取顯示秒數(shù)的元素,通過定時(shí)器來更改秒數(shù)。
? ? ? ?if(y=0){
? ? window.open("http://idcbgp.cn/code/1633")
? ? ? ? ? ? ? }
? ? ?//通過window的location和history對(duì)象來控制網(wǎng)頁的跳轉(zhuǎn)。
? ? ? ? else
? ? ? ? ? ? {
? ? ? ?y--;
? ? ? ?document.getElementById("seconds1").innerHTML=y
? ? ? ? setInterval("daojishi",1000*1)
? ? ? ? ? ? ?}
? ?}
?</script>?
?<span id="seconds1">
? ? ?5
?</span>秒后返回主頁
?<a href="#" onclick="http://idcbgp.cn/code/1633" >
? ? 返回?
?</a>
</body>
</html>
2022-02-09