Various page timing jump of countdown jump code summary

  • 2020-03-26 21:38:12
  • OfStack

The following is a summary of the page timing jump (also known as countdown jump), a variety of timing jump code records as follows:

(1) setTimeout function is used to realize timing jump (the following code should be written in the body area)
<script type="text/javascript"> 
//After 3 seconds it jumps to the specified page

(2) HTML code implementation, add the following code in the head area block of the page
<!--5 Jumps to the specified page after seconds --> 
<meta http-equiv="refresh" content="5;url=" /> 

(3) a little more complex, more in the timing of the jump after landing
<!doctype html> 
<meta charset=utf-8" /> 
<title>js The method of regular jump page </title> 
var t=10;//Set the jump time
setInterval("refer()",1000); //Activate 1 second timer
function refer(){ 
location=""; //Set the link address for the jump
document.getElementById('show').innerHTML=""+t+" Seconds after the jump to baidu "; //Display countdown
t--; //Counter decrement
<span id="show"></span> 

Related articles: