幫我看看代碼,沒(méi)效果
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對(duì)象</title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
? <style type="text/css">
????? h4{font-weight:bold;
????? color:red;
????? }
? </style>
?</head>
?<body>
? <!--先編寫(xiě)好網(wǎng)頁(yè)布局-->
? <h4>操作成功</h4>
? <input type=text id="shu"/>
? <input type=button value="返回" onclick="myfunction()" />
? <script type="text/javascript"> ?
? var num=5;
? function daoshu()
? {
??? ?
????? document.getElementById("shu").value=num+"秒回到主頁(yè)";
????? num--;
????? setTimeOut("daoshu()",1000);
?????? if(num==1)
????? {
????????? window.open("http://idcbgp.cn","_blank");
????? }
? }
???? setTimeOut("daoshu()",1000);
?? //獲取顯示秒數(shù)的元素,通過(guò)定時(shí)器來(lái)更改秒數(shù)。
??? function myfunction(){
??????? window.history.back();
??? }
?? //通過(guò)window的location和history對(duì)象來(lái)控制網(wǎng)頁(yè)的跳轉(zhuǎn)。
? ?
?</script>
</body>
</html>
2016-12-08
setTimeout ? ? ? ? ? ? ? ? ? ? ? ? o 小寫(xiě)