5S后返回首页
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>5S后返回首頁</title> 5 <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> 6 </head> 7 <body> 8 <h2>操作成功</h2> 9 <p><a id="showtime">5s后回到主頁</a> <a href="window.history.back()">返回</a></p> 10 11 12 <script type="text/javascript"> 13 14 //通過window的location和history對象來控制網(wǎng)頁的跳轉。 15 var flag = 5; 16 17 var timer = setInterval(function(){ 18 19 document.getElementById("showtime").innerHTML=flag+"秒后自動跳轉到主頁"; 20 21 flag=flag-1; 22 23 if(flag<=0){ 24 25 window.location.href=""; 26 27 } 28 29 },1000); 30 31 </script> 32 </body> 33 </html>
?
轉載于:https://www.cnblogs.com/calamus/p/7308209.html
總結
- 上一篇: 排序算法7---快速排序算法
- 下一篇: 楼主是之前那个因为相亲很困惑求分析的,现