為啥沒有反應呢,無論是自動跳轉(zhuǎn)還是超鏈接?
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對象</title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? <!--先編寫好網(wǎng)頁布局-->
? <h3>操作成功</h3><br/>
?<span id="time">秒后回到主頁</span> <a href="javascript:goback()">返回</a>
? <script type="text/javascript">??
? ?var num=5;
? ?//獲取顯示秒數(shù)的元素,通過定時器來更改秒數(shù)。
? ?function fun(){
? ? ? ?document.getElementById("time").innerHTML=num;
? ? ? ?num=num-1;
? ? ? ?if(num==0){
? ? ? ? ? ?window.hitory.forward();
? ? ? ?}
? ?}
? ?setInterval("fun()",1000);
? ?//通過window的location和history對象來控制網(wǎng)頁的跳轉(zhuǎn)。
? ?goback(){
? ? ? ? window.location. ;
? ?}
?</script>?
</body>
</html>
2020-10-14
你是不是想寫window.history.forward,結(jié)果history寫成了hitory
2020-09-10
建議使用自己的代碼工具再實驗一下