日期:2014-05-17 浏览次数:20779 次
<% String loginURL = "login.jsp"; String user = (String) session.getAttribute("username"); if (user == null) { response.setHeader("Refresh", "1;URL=" + loginURL); out.println("成功退出!1秒后跳转登录界面!"); } %>
------解决方案--------------------
<script type="text/javascript"> var timer = window.setInterval("Timer()",1000);//启用定时倒计 var secs = 5; function Timer() { secs--; document.getElementById("btnShow").innerHTML = "倒计时:[" + secs + "]"; if(secs == 0){ window.clearInterval(timer);//清楚定时任务 window.location.href="地址"; } } </script>