Countdown and automatic page Jump in JSP

Source: Internet
Author: User

The teacher said that he would write a blog, and then he could only pull the blog that has not been moved for many years. Today, I will share the countdown in JSP and the automatic jump page.

Crazy, then the code was too difficult to complete, and the webpage went wrong.

1. Create an onload event in the tag for automatic refresh;

<Body onload = "shownum ()">

2. Compile the onload event in <script>:

<Script type = "text/javascript"> var I = 6; function shownum () {I = I-1; document. getElementById ("time "). innerHTML = I + "automatically jump to the logon page in seconds"; setTimeout ('shownum () ', 1000) ;}</script>

3. Compile an automatic redirect event:

<Meta http-equiv = "refresh" content = "5; url = <% = basePath %> jsp/login. jsp">

4. Get it done

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.