What is the html URL jump code?

青灯夜游
Release: 2023-01-06 11:17:52
Original
13903 people have browsed it

htmlJump code: 1. ""; 2. ""; 3. "window.location.href = 'website address';".

What is the html URL jump code?

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

HTML metal jump

In the HTML page, you can use the meta tag to enter the page jump. This method can control the jump time and liberalize it. Define the jump URL

htmlThe jump code is as follows

 <meta http-equiv="refresh" content="5;url=https://www.php.cn">
Copy after login

Code explanation

Looking at the above code, there is a content attribute in the meta tag, indicating that after opening this page , how many seconds will it take to start the jump. There is also a URL attribute, indicating the redirected URL

The A tag in HTML jumps

The A tag in HTML can also be regarded as a page jump kind, just click the mouse to enter the jump

html A label jump code is as follows

<a href="https://www.php.cn">php中文网</a>
Copy after login

javascript code jump

Use on the web page jjs can also realize page jumps or timed jumps

The JS jump code is as follows

<script language="javascript" type="text/javascript">   
    // 以下方式直接跳转  
    //php中文网
    window.location.href = &#39;https://www.php.cn/&#39;;
    // 五秒以后再跳转
    setTimeout("javascript:location.href=&#39;https://www.php.cn&#39;", 5000);   
</script>
Copy after login

[Related recommendations: javascript learning tutorial]

The above is the detailed content of What is the html URL jump code?. 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!