倒计时跳转页面

页头添加

<%--url不需要引号--%>
<meta http-equiv=refresh content=10;url=要跳转的网页链接>

js代码

<div id="skip">
    <b>10</b>秒钟后自动跳转到登录页面...&nbsp;如果不跳转<a
        href="">点击登录</a>
</div>
<script>
    function countDown(secs) {
        $("#skip b").html(secs);
        if (--secs > 0)
            setTimeout("countDown(" + secs + " )", 1000);
    }
    //这里设置的是10秒
    countDown(10);
</script>

猜你喜欢

转载自blog.csdn.net/whw_hi/article/details/90202387