<!DOCTYPE?html>
<html>
?<head>
??<title>瀏覽器對(duì)象</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=gkb"/>???
?</head>
?<body>
??<!--先編寫好網(wǎng)頁(yè)布局-->
??<h3>操作成功</h3>
?<input?id='sec'?type='text'style='border:none;width:6px'value='5'>?秒后返回主頁(yè)?<a?href=''onclick="history.go(-1)"?>返回</a>
??
?
??<script?type="text/javascript">??
????var?sec1=document.getElementById("sec");
????setTimeout(sec2,1000);
????var?num=5;
????function?sec2(){
????????
????????num--;
????????sec1.value=num;
?????????if(num<1){
????????????location.href='http://idcbgp.cn/course/list';
????????}
????????setTimeout(sec2,1000);
???????
????????}
???//獲取顯示秒數(shù)的元素,通過(guò)定時(shí)器來(lái)更改秒數(shù)。
???//通過(guò)window的location和history對(duì)象來(lái)控制網(wǎng)頁(yè)的跳轉(zhuǎn)。
???
?</script>?
</body>
</html>
2015-12-15