用计时器重定向
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用计时器重定向相关的知识,希望对你有一定的参考价值。
You can use javascript window.location to redirect a visitor to a required page. You may have seen this feature used by sites with full page ads, or to redirect visitors to the site's new domain name. You can add also a timer to the script that will allow the page to redirect and the visitors will not need to click a link or type in the new URL.
<script type="text/javascript"> var count = 6; function countDown(){ var timer = document.getElementById("timer"); if(count > 0){ count--; setTimeout("countDown()", 1000); }else{ window.location.href = redirect; } } </script> Our webpage has beed moved. Please update your bookmarks for the new site. <br> <span id="timer"> <script type="text/javascript">countDown();</script> </span>
以上是关于用计时器重定向的主要内容,如果未能解决你的问题,请参考以下文章
从 servlet 过滤器重定向到 jsf 会返回未呈现为 html 的实际 jsf 代码
ios如何将自定义控制器重定向obj-c代码放在自定义视图中