How to use JS to realize the jump of login page in JSP (how to use JS to implement jump page in JSP)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.