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

Detailed explanation of page jump summary

小云云
小云云Original
2018-02-22 13:10:241283browse

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;">

JS jump page code

Jump to this page

window.location.href = '链接';
window.location = '链接';
location.href = '链接';
location = '链接';
top.location = '链接';

Jump to new page

window.open('链接');
open('链接');

Or add target="_blank":

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

History jump

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

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!

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