大神,幫忙看看,哪里有問題
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對象</title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? <!--先編寫好網(wǎng)頁布局-->
? <h1>操作成功</h1>
? <span id="sencond">5</span>
? <span>秒后回到主頁</span>
?<a href="javascript:back">返回</a>
? <script type="text/javascript"> ?
?
?? //獲取顯示秒數(shù)的元素,通過定時器來更改秒數(shù)。
var num=document.getElementById("sencond").value;
function cound()
??? {
??????? num--;
??????? document.getElementById("sencond").innerHTML=num;
??????? if(num==0)
??????????? {
??????????????? location.assign("idcbgp.cn");
??????????? }
??? }?????? ?
??????????? setInterval("cound()",1000);
?? ?
?? //通過window的location和history對象來控制網(wǎng)頁的跳轉(zhuǎn)。
?? function back
??? {
??????? window.history.back();
??? }
?</script>
</body>
</html>
2019-06-13
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對象</title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? <!--先編寫好網(wǎng)頁布局-->
? <h1>操作成功</h1>
? <span id="second">5</span>
? <span>秒后回到主頁</span>
?<a href="#" onclick="back();">返回</a>
? <script type="text/javascript">??
?
? ?//獲取顯示秒數(shù)的元素,通過定時器來更改秒數(shù)。
var num=document.getElementById("second").innerHTML;
function cound()
? ? {
? ? ? ? num--;
? ? ? ? document.getElementById("second").innerHTML=num;
? ? ? ? if(num==0)
? ? ? ? {
? ? ? ? ? location.assign("http://idcbgp.cn");
? ? ? ? }
? ? }? ? ? ??
? ? setInterval("cound()",1000);
? ??
? ?//通過window的location和history對象來控制網(wǎng)頁的跳轉(zhuǎn)。
? ?function back()
? ? {
? ? ? window.history.back();
? ? }
?</script>?
</body>
</html>
自己對一下吧!望采納!