jsp页面5秒跳转
1.写一个倒计时的方法(转载)
<script type="text/javascript">
$(function(){
var count=6;
function time(){
count--;
if(count==0) {
location.href="../main/main.jsp";
}else{
$("#second").text(count);
setTimeout(time,1000);
}
}
time();
});
</script>
2.设置一个跳转链接的倒计时
还有<font color="red"><strong><span id="second"></span></strong></font>秒,回到首页!