倒计时实现页面关闭

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<% String url=basePath+"Login.jsp"; %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
   
    <title></title>
    <meta http-equiv=refresh content=10;url=<%= url %>>
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">   
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
 <!--
 <link rel="stylesheet" type="text/css" href="styles.css">
 -->

  </head>
 <script type="text/javascript">
 function countDown(secs) {
  document.getElementById("jump").innerHTML = secs;
  if (--secs > 0)
   setTimeout("countDown(" + secs + " )", 1000);
 }
 </script>
 
  <body onload=countDown(10); >
    瀵逛笉璧?鐧婚檰澶辫触.......<br>
    绯荤粺鍦?font color="red"><span id="jump">10</span></font>绉掑悗灏嗚嚜鍔ㄨ繑鍥?杩呴€熻繑鍥?璇风偣鍑?a href="Login.jsp">杩斿洖</a> 
  </body> 
</html>

你可能感兴趣的:(JavaScript,html,jsp,css,cache)