JS实现倒是54321并且跳转页面的代码

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String userName=request.getParameter("userName");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<meta http-equiv="refresh"content="5; url=index.jsp">
<title>Insert title here</title>
<script type="text/javascript">
var time =5;  
function number(){  
      window.setTimeout("number()",1000);  
      if(time >= 0){  
         var obj = document.getElementById("number");  
         obj.innerHTML = "";  
         obj.innerHTML = "系统还有"+time+"秒为您跳转到首页";  
         time--;  
      }  
}     
</script>
</head>
<body onload="number()">
 <jsp:include page="head.jsp"></jsp:include>
 <center>
<span style="font-size:24px"宋体";" align="center"><img alt="" src="../images/01.png">恭喜您,注册成功!</br>您的登录名为:<%=userName%><div id="number"></div></span>
</center>
</body>
</html>

你可能感兴趣的:(JS实现倒是54321并且跳转页面的代码)