大神,幫忙看看,哪里有問題
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對象</title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? <!--先編寫好網頁布局-->
? <h1>操作成功</h1>
? <span id="sencond">5</span>
? <span>秒后回到主頁</span>
?<a href="javascript:back()">返回</a>
? <script type="text/javascript"> ?
?
?? //獲取顯示秒數的元素,通過定時器來更改秒數。
var num=document.getElementById("sencond").value;
function cound()
??? {
??????? num--;
??????? document.getElementById("sencond").innerHTML=num;
??????? if(num==0)
??????????? {
??????????????? location.assign("www.xianlaiwan.cn");
??????????? }
??? }?????? ?
??????????? setInterval("cound()",1000);
?? ?
?? //通過window的location和history對象來控制網頁的跳轉。
?? function myback
??? {
??????? window.history.back();
??? }
?</script>
</body>
</html>
2019-06-06
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對象</title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? <!--先編寫好網頁布局-->
?<div class="test">
? ? <p class="tips">操作成功</p>
? ? <p class="comeback"><span id="backtime">5</span>秒后回到主頁<a href="#" onclick="GoBack()">返回</a>
? ? </p>
? </div>
? <script type="text/javascript">??
??
?
? <script type="text/javascript">??
?
? ?//獲取顯示秒數的元素,通過定時器來更改秒數。
var a=5;
? ? function countDown(){
? ? ? ? document.getElementById("backtime").firstChild.nodeValue=a;
? ? ? ? a--;
? ? ? ? if(a==0){
? ? ? ? ? ? location.assign("http://www.xianlaiwan.cn");
? ? ? ? }
? ? }
? ? var q =setInterval("countDown()",1000);
? ? function GoBack() {
? ? ? ? window.history.back();? ??
? ? ? ? }
? ?//通過window的location和history對象來控制網頁的跳轉。
? ?
?</script>?
</body>
</html>