Home > Web Front-end > JS Tutorial > Detailed explanation of page jump summary

Detailed explanation of page jump summary

小云云
Release: 2018-02-22 13:10:24
Original
1263 people have browsed it

This article mainly shares with you a summary and detailed explanation of page jumps, hoping to help everyone better master the knowledge of page jumps.

HTML tag

Generally, you can use <a></a>, <button></button> , <input/>

<a href="链接">GO</a>
<button onclick="window.location.href=&#39;链接&#39;">GO</button>
<input type="button" value="GO" onclick="location.href=&#39;链接&#39;">
Copy after login

JS jump page code

Jump to this page

window.location.href = '链接';
window.location = '链接';
location.href = '链接';
location = '链接';
top.location = '链接';
Copy after login

Jump to new page

window.open('链接');
open('链接');
Copy after login

Or add target="_blank":

<a href="链接" target="_blank">GO</a>
Copy after login

History jump

<a href="history.go(-1)">返回上一步</a>
<a href="window.history.back()">返回上一步</a>
Copy after login

Related recommendations:

Detailed explanation of WeChat applet page jump event binding examples

Router solves page jumps under cross-modules

WeChat applet click text Method to implement page jump function

The above is the detailed content of Detailed explanation of page jump summary. 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