JavaScript实现页面跳转
2013-10-04 22:24
555 查看
1、源码如下
2、运行结果
(1)初始化
(2)跳转后
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <title>404 Not Found</title> </head> <body> <h1>找不到指定的页面</h1> <span id="totalSecond">3</span>秒后自动返回 </body> <script language="javascript" type="text/javascript"> <!-- var second = document.getElementById('totalSecond').textContent; if (navigator.appName.indexOf("Explorer") > -1) //判断是IE浏览器还是Firefox浏览器,采用相应措施取得秒数 { second = document.getElementById('totalSecond').innerText; } else { second = document.getElementById('totalSecond').textContent; } setInterval("redirect()", 1000); //每1秒钟调用redirect()方法一次 function redirect() { if (second < 0) { location.href = 'http://www.baidu.com'; } else { if (navigator.appName.indexOf("Explorer") > -1) { document.getElementById('totalSecond').innerText = second--; } else { document.getElementById('totalSecond').textContent = second--; } } } --> </script> </html></td> </tr> </table>
2、运行结果
(1)初始化
(2)跳转后
相关文章推荐
- JavaScript实现3秒后页面自动跳转
- 用JavaScript怎么实现页面跳转
- Javascript页面跳转常见实现方式汇总
- JavaScript的location对象实现跳转、刷新页面
- javascript跳转页面:Javascript实现页面跳转的几种方式收藏
- PHP+JAVASCRIPT实现自动弹出打印窗口并自动跳转页面的实例
- javascript 实现页面跳转的方法
- JavaScript实现x秒后自动跳转到一个页面
- Javascript实现页面跳转的几种方式收藏(转)
- JavaScript实现定时页面跳转功能示例
- 利用javaScript实现页面倒计时跳转
- Javascript实现页面跳转的几种方式
- javascript实现页面跳转的几种方法
- javascript实现页面跳转的方法
- js(javascript)实现页面跳转的几种方式和写法
- javascript实现页面跳转的几种方式
- Javascript实现页面跳转的几种方式分享
- JavaScript实现x秒后自动跳转到一个页面
- 原始的JAVASCRIPT实现的WEB页面跳转以及页面间传值方法
- JavaScript实现单击下拉框选择直接跳转页面的方法