JS 3 seconds after the jump page implementation code

Source: Internet
Author: User

  This article mainly introduces the JS 3 seconds after the jump page implementation code, the need for friends can refer to the following

How many seconds after the automatic jump to other pages (JS script)     method one:   in <head></head> to add JS     code as follows: <script language= " JavaScript "> var secs = 3; Number of seconds to Countdown   VAR URL; function Load (URL) {url = URL; for (var i=secs;i>=0;i--)   {     window.settimeout (' doupdate (' + i + ') ', (secs-i) * 1000); } } function doupdate (num)   {  document.getElementById (' Showdiv '). InnerHTML = ' will automatically jump to home page ' after ' +num+ ' seconds; if (num = = 0) {window.location = URL;}} </script>     Then add <body onload= "Load (' index.asp ')" in <body> to the page for which you want to jump index.asp.   between <body></body> plus <div id= "Showdiv" ></div>   method two:     code as follows: <p style= " Text-indent:2em; margin-top:30px; " > system will automatically jump to the new URL after <span id= "time" >5</span> seconds, if it fails to jump, <a href= "http://www.jb51.net" title= "click to visit" > Please click on </a>. </p> <script type= "Text/javascript" >       delayurl ();         Function Delayurl () {          var delay = document.getElementById ("Time"). InnerHTML;  var t = Sett Imeout ("Delayurl ()", 1000);         if (Delay > 0) {            delay--      &N Bsp     document.getElementById ("Time"). InnerHTML = delay;        } else {     cleartimeout (t);              Window.location.href = "Http://www.jb51.net";        }            }  </script>  

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.