Home  >  Article  >  Web Front-end  >  Let the webpage redirect to other pages after opening it for a few seconds_HTML/Xhtml_Webpage Production

Let the webpage redirect to other pages after opening it for a few seconds_HTML/Xhtml_Webpage Production

WBOY
WBOYOriginal
2016-05-16 16:41:362500browse

Just add the following code to achieve it.
The first method: use Meta
Usage:

The first statement is to stay for 30 seconds and automatically refresh, and the second statement is to stay for 5 seconds and redirect to sc.jb51.net. Use respectively to achieve automatic refresh or automatic steering functions.

Second type: js implementation
setTimeout(function(){window.location.href = 'http://sc.jb51.net';},2000)
The third type of js code with countdown

Copy the code
The code is as follows:



Jump after 10 seconds







Of course the page jump function can also be implemented using js, but the above code The advantage is that it can also be used when browsing does not support js. If you want to achieve a real-time countdown effect, you need to use js to achieve it. Under normal circumstances, you can combine the two to judge.
Javascript page jump method collection
Page jump code implemented with meta
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn