為什么直接用setTimeOut設(shè)置5秒后跳轉(zhuǎn)不行呢,想請(qǐng)教大家
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對(duì)象</title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? <!--先編寫(xiě)好網(wǎng)頁(yè)布局-->
? <h1>操作成功</h1>
? <p>5秒后回到主頁(yè) <a href="javascript:" onclick="history.back()" >返回</a></p>
??
? <script type="text/javascript">??
? ? function moveToAdd(){
? ? ? ? window.location.replace("http://idcbgp.cn/");
? ? }
setTimeOut("moveToAdd()", 5000);
? ??
? ??
? ?//獲取顯示秒數(shù)的元素,通過(guò)定時(shí)器來(lái)更改秒數(shù)。
? ?//通過(guò)window的location和history對(duì)象來(lái)控制網(wǎng)頁(yè)的跳轉(zhuǎn)。
? ?
?</script>?
</body>
</html>
2020-09-23
setTimeout(moveToAdd, 5000);
2020-09-08
你的計(jì)時(shí)機(jī)去哪里了