<!DOCTYPE?html><html>?<head>??<title>瀏覽器對象</title>????<meta?http-equiv="Content-Type"?content="text/html;?charset=gkb"/>????</head>?<body>??<!--先編寫好網(wǎng)頁布局-->??<h3>操作成功</h3>??<script?type="text/javascript">?????//獲取顯示秒數(shù)的元素,通過定時器來更改秒數(shù)。???var?mytime?=5;???function?count()???{???????if(mytime<1)???????{???????????window.open("http://idcbgp.cn");???????}???????else???????{???????????document.getElementById("lefttime").innerHTML=mytime;???????????mytime?=?mytime?-?1;???????}???}??setInterval("count()",1000);???//通過window的location和history對象來控制網(wǎng)頁的跳轉。?function?return()?{?????window.history.back()?}??</script>?<p><span?id="lefttime"?>5</span>?<span>秒后回到主頁</span>?<a?href="">返回</a></p></body></html>
2018-07-04
你目前是個什么問題..代碼跑起來哪里出問題了?