<!DOCTYPE?html>
<html>
?<head>
??<title>瀏覽器對象</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=gkb"/>???
?</head>
?<body>
??<!--先編寫好網(wǎng)頁布局-->
??<h1>操作成功</h1>
??<h2><span?id="seconds">5</span>秒后回到主頁 <a?href="javascript:history.back()">返回</a></h2>
?
?
??<script?type="text/javascript">?
??function?clock(){
??????var?nowtime=new?Date();
??????var?num=nowtime.getSeconds();
??????document.getElementById("seconds").innerHTML=num;
??????if(num=0){
?????????document.getElementById("seconds").innerHTML=num--1;
??????}
??????else{
??????????window.history.go(-1);
??????}
???}
??setInterval("clock()",1000);
???//獲取顯示秒數(shù)的元素,通過定時器來更改秒數(shù)。
???//通過window的location和history對象來控制網(wǎng)頁的跳轉(zhuǎn)。
???
?</script>?
</body>
</html>
沒辦法運行倒數(shù)計時器,不知道怎么改,求指導(dǎo)
階段性生物
2016-11-13 20:35:43