Just add the following code to achieve it. Method 1: Using Meta Usage: <Meta http-equiv=Refresh Content=30> <Meta http-equiv="Refresh" Content="5; Url=http://sc.jb51.net"> The first statement is to stay for 30 seconds and automatically refresh, and the second one is to stay for 5 seconds and redirect to sc.jb51.net. Use them separately to achieve automatic refresh or automatic steering functions. The second method: js implementation setTimeout(function(){window.location.href = 'http://sc.jb51.net';},2000) The third js code with countdown Copy code The code is as follows:<html> <head> <title>Jump after 10 seconds</title> </head> <body> <input type="text" readonly="true" value="10" id="time"> </body> <script language="javascript"> var t = 10; var time = document.getElementById("time"); function fun(){ t--; time.value = t; if(t<=0){ location.href = "https://www.jb51.net"; clearInterval(inter); } } var inter = setInterval("fun()",1000); </script> </html> The page jump function can of course be implemented using js, but the advantage of the above code is that it can also be used when the browser does not support js. If you want to achieve a real-time countdown effect, you need to use js to implement it. Generally, you can combine the two to make a judgment. javascript page jump method collection page jump code implemented using meta |
<<: Detailed explanation of vue-router 4 usage examples
>>: Detailed tutorial on installing CentOS, JDK and Hadoop on VirtualBox
1. <body> tag: Used to mark the main body o...
Table of contents Pull the image Run the image (g...
Table of contents 1. Experimental Environment 2. ...
When the amount of data in MySQL is large, limit ...
By right-clicking the source file, the following c...
This article introduces the characteristics of CS...
Preface I am currently working on a high-quality ...
Table of contents 1. Initialization structure 2. ...
Table of contents Writing Background Project Desc...
1. Table structure 2. Table data 3. The query tea...
I slept late yesterday and was awake the whole da...
Maybe you are using include files here, which is u...
Based on SEO and security considerations, a 301 r...
Table of contents 1. Communication between father...
Table of contents 1. Generate a certificate 2. En...