How to use JS to realize the jump of login page in JSP (how to use JS to implement jump page in JSP)
Note: Just use the setTimeout () in JS, the specific use method:
setTimeout ( function name , time (ms));
setTimeout () is the method that belongs to window, but we omit the name of the top object of window, which is used to set a time, when time is up, a specified method is executed. setTimeout () is usually used in conjunction with the function.
Examples:
1 <%@ Page Language="Java"ContentType="text/html; Charset=utf-8"
2pageencoding="UTF-8"%>
3<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd ">
4<HTML>
5<Head>
6<Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">
7<title>Login the System information.</title>
8</Head>
9<Body>
Ten<H1Align= "Center">Login the System information.</H1>
One
A<%!StringURL =NULL;
-StringWord =NULL;%>
-<%
theStringTag = (String) request.getsession (). getattribute ("Tagtomboard");
-if(Tag = ="0") {
-URL ="/hruinger/index.jsp";
-Word ="The user information you entered is not correct, please check and re-enter! is going to the login page for you.";
+}
-if(Tag = ="1") {
+URL ="/hruinger/messageboard.jsp";
AWord ="The verification code you entered is not correct, please check and re-enter! is going to the login page for you.";
at}
-if(Tag = ="2") {
-URL ="/hruinger/messageboard.jsp";
-Word ="you are logged in, welcome to your use! is moving you to the main interface.";
-}
-%>
in
-<H3Align= "Center">
to<ahref=<%=url%>><%=word%></a>
+</H3>
-
the</Body>
* </HTML>
$<Scripttype= "Text/javascript">
Panax NotoginsengfunctionJumpurl () {
-Window.location= "<%=url%>";
the}
+SetTimeout (' Jumpurl () ', 4000);
A</Script>
How to use JS to realize the jump of login page in JSP (how to use JS to implement jump page in JSP)