<script type="text/javascript"> var t = 5;//设定跳转的时间 setInterval("refer()", 1000); //启动1秒定时 function refer() { if (t == 0) { location = "three.jsp"; //设定跳转的链接地址 } document.getElementById('show').innerHTML ="登录成功!!!"+ t + "秒后跳转到three.jsp页面"; //显示倒计时 t--; //计数器递减 } </script>