首页 > 其他 > 详细

5S后返回首页

时间:2017-08-08 18:55:13      阅读:161      评论:0      收藏:0      [点我收藏+]
 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对象来控制网页的跳转。
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>

 

5S后返回首页

原文:http://www.cnblogs.com/calamus/p/7308209.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!