TA的每日心情 | 衰 2021-2-2 11:21 |
---|
签到天数: 36 天 [LV.5]常住居民I
|
js控制5秒后页面自动跳转,代码如下:
- <html>
- <head>
- <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
- <meta http-equiv=”refresh” content=”11;url=http://www.jfox.info/”>
- <title>js控制10秒后页面自动跳转</title>
- <script type=”text/javascript”>
- function countDown(secs,surl){
- //alert(surl);
- var jumpTo = document.getElementById(‘jumpTo’);
- jumpTo.innerHTML=secs;
- if(–secs>0){
- setTimeout(“countDown(“+secs+”,’”+surl+”‘)”,1000);
- }
- else{
- location.href=surl;
- }
- }
- </script>
- </head>
- <body><span id=”jumpTo”>10</span>秒后自动跳转到http://www.jfox.info/
- <script type=”text/javascript”>countDown(10,’http://www.jfox.info/‘);</script>
- </body>
- </html>
复制代码
|
|