<!DOCTYPE?html>
<html>
?<head>
??<title>瀏覽器對象</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=gkb"/>???
?</head>
?<body>
??<!--先編寫好網頁布局-->
??<h3>操作成功</h3>
?<input?id='sec'?type='text'style='border:none;width:6px'value='5'>?秒后返回主頁?<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://www.xianlaiwan.cn/course/list';
????????}
????????setTimeout(sec2,1000);
???????
????????}
???//獲取顯示秒數的元素,通過定時器來更改秒數。
???//通過window的location和history對象來控制網頁的跳轉。
???
?</script>?
</body>
</html>
2015-12-15