How to automatically jump to the page in html

青灯夜游
Release: 2021-05-06 13:55:09
Original
4999 people have browsed it

html Method to automatically jump to the page: 1. Use the "" statement to jump; 2. Use " window.location.href='page address';" statement jumps.

How to automatically jump to the page in html

The operating environment of this tutorial: windows7 system, HTML5&&javascript version 1.8.5, Dell G3 computer.

1. Use meta to jump in html. You can set the jump time and page through meta.

<head>
<!--只是刷新不跳转到其他页面 -->
<meta http-equiv="refresh" content="5">
<!--定时转到其他页面 -->
<meta http-equiv="refresh" content="5;url=index.html"> 
</head>
Copy after login

2. Jump through javascript

// 直接跳转
window.location.href='index.html';
// 定时跳转
setTimeout("javascript:location.href='index.html'", 5000);
Copy after login

For more programming-related knowledge, please visit: Programming Video! !

The above is the detailed content of How to automatically jump to the page in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!