js定时三秒后自动跳转页面
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@include file="/common/common.jsp" %>
<html>
<head>
<base href="<%=basePath%>">
<title>修改论文</title>
<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">
<script src="script/Calendar.js" type="text/javascript"></script>
<link href="css/css.css" rel="stylesheet" />
</head>
<script type="text/javascript">
var time = 4;
function clock(){
time--;
document.getElementById("info").innerHTML = "窗口将在"+time+"秒后自动跳转";
var action = document.getElementById("me").value;
if(time==0){
window.location.href="actions/"+action;
}
}
setInterval("clock();",1000);
</script>
<body>
<table width="50%" align="center" cellspacing="0" class="faTable">
<tr>
<td align="center" class="faTdleft" id="info" >
发送成功!本窗口将在3秒后自动跳转
</td>
<input type="hidden" id="me" value="${action}" />
</tr>
</table>
</body>
</html>