- <script type="text/javascript">
- var tim = 5;
- setInterval(function(){
- tim--;
- if (tim == 0) {
- location.replace('http://www.baidu.com');
- }
- document.getElementById('num').innerhtml = tim;
- },1000)
- </script>
- </head>
- <body>
- <h1>网站倒计时跳转,倒计时:<span id="num">5</span></h1>
- </body>
- //该片段来自于http://www.codesnippet.cn/detail/1410201410617.html
来源: http://www.codesnippet.cn/detail/1410201410617.html