1. Descending jump per second
Copy Code code as follows:
<script language=javascript>
function out (obj) {
var i = obj;
if (i==0)
Document.location.href= "index.jsp";
Document.body.innerHTML = i;
i--;
SetTimeout ("Out" ("+i+") ", 1000);
}
</script>
<body onload= "Out (5);" >
</body>
2. Using the Response.setheader function
Copy Code code as follows:
<%response.setheader ("Refresh", "5; Url= ... ");%>
3. Using META tags
Copy Code code as follows:
<meta http-equiv= "REFRESH" content= "2"; url=xxxx.jsp ">
JSP page to achieve automatic jump!
One, the page automatically refreshes:
Add the following code to the
Copy Code code as follows:
<meta http-equiv= "Refresh" content= "5" >
Note: content= "5" is time control, which means that the page is refreshed every 5 seconds.
Second, the page automatically jump:
Add the following code to the
Copy Code code as follows:
<meta http-equiv= "Refresh" content= "1;url=index.jsp" >
Note: content= "1 is Time control, means 1 seconds after automatically jump to the page to jump."
Content= "0 means that when you open the page, immediately jump to the page you want to jump to.
Url=index.jsp is the page to jump