自动跳转到如下网址,CSDN的破玩意。拿过来用了。

来源:互联网 发布:h3c端口 模式区别 编辑:程序博客网 时间:2024/04/29 09:22

<div>
 <?php
 echo $this->tipContent;
 ?>
<p>
<strong>
<span id="span_text">系统会在
<span id="span_timer">3</span>秒后,自动跳转到如下网址:ַ</span>
</strong>
<br />
<a id="a_url" href="<?php echo  empty($this->url)?SITE_URL:$this->url;?>" class="font_red">
<?php echo empty($this->url)?SITE_URL:$this->url;?>
</a>
<br />
</p>
<div id="collocate" style="display: none">
<script type="text/javascript">
    (function() {
        var total = 3;
        var span_timer = document.getElementById("span_timer");
        span_timer.innerHTML = total;
        var timer = setInterval(function() {
            if (total <= 0) {
                location.href = document.getElementById("a_url").href;
                clearInterval(timer);
                timer = 0;
            } else span_timer.innerHTML = --total;
        }, 1000);        
    })();
</script>
</div>
</div>

原创粉丝点击