為什么倒計(jì)時(shí)到了0還是沒有跳轉(zhuǎn)?
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對(duì)象</title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> ??
?</head>
?<body>
? <!--先編寫好網(wǎng)頁布局-->
? <h1>操作成功</h1>
? <p><b id="second">5</b>秒后回到主頁<a href="javascript:goBack();">返回</a></p>
? <script type="text/javascript"> ?
? ?//獲取顯示秒數(shù)的元素,通過定時(shí)器來更改秒數(shù)。
? ?var shuzi=document.getElementById('second').innerHTML;
? ?setInterval('miaoshu()',1000);
? ?function miaoshu(){
? ? ? ?shuzi--;
? document.getElementById('second').innerHTML=shuzi;
? ?if(shuziL==0)
? ?{
? location.assign("http://www.baidu.com");
? }
? ?}
? ?
? ?//通過window的location和history對(duì)象來控制網(wǎng)頁的跳轉(zhuǎn)。
? ?function GoBack()
? ?{
? ? ? ?window.history.go(-1);
? ?}
?</script>?
</body>
</html>
2016-11-10
你的if判斷中 ?shuzi寫錯(cuò)了 ?多個(gè)L
2016-11-11
。。。