asp.net如何实现定时页面跳转

< script>setTimeout("location.href='url'",2000)< /script> 
< meta http-equiv="refresh" content="300; url=target.html"> 用window.location.href

方法二:

            <script type="text/javascript">
                var secs = 30; //6为倒计时秒数
                for (i = 0; i <= secs; i++) {
                    window.setTimeout("update(" + i + ")", i * 100);
                }

                function update(num) {
                    if (num == secs) {
                        window.location = "/Default.aspx"; //跳转的页面URL
                    }
                    else {
                        printnr = secs - num;
                        document.getElementById('sec').innerHTML = printnr;
                    }
                }
            </script>

  

 

 

 http://bbs.csdn.net/topics/340160360

posted @ 2012-11-12 21:48  ishibin  阅读(314)  评论(0编辑  收藏  举报