<body> <h1> 操作成功 </h1> <span id="second">5</span> <span id=""> 秒后回到主頁 </span> <a href="javascript:back()">返回</a> <script> var num = document.getElementById("second").innerHTML; function add() { --num; document.getElementById("second").innerHTML = num;? ? ? ? ? ? ? ? if(num==0) { location.assign('http://www.xianlaiwan.cn'); } } ? setInterval("add()", 1000); function back() { window.history.back(); } </script> </body>
這個為何沒法用location.href('http://www.xianlaiwan.cn');
Youruncle
2016-07-29 08:50:52