<!DOCTYPE?html><html>?<head>??<title>瀏覽器對(duì)象</title>????<meta?http-equiv="Content-Type"?content="text/html;?charset=gkb"/>????</head>?<body>??<!--先編寫好網(wǎng)頁布局-->??<h1>操作成功</h1>???<p><span?id="clock">5</span>秒后回到主頁<a?href="javascript:back()">返回</a></p>??????<script?type="text/javascript">????var?num=document.getElementById("clock").innerHTML;????function?count(){???????????num--;????????????document.getElementById("clock").innerHTML=num;????????????if(num==0)????????????{????????????????window.open('http://idcbgp.cn','_blank','width=400,height=400');????????????}?????????????????}??????setInterval("count()",1000);???????function?back(){???????????window.history.back();???????}??????????</script></body></html>
2018-08-02
這一句寫錯(cuò)了: window.open('http://idcbgp.cn','_blank','width=400,height=400');改為?window.location.href="http://idcbgp.cn/";?如何還不行,就是細(xì)節(jié)問題了