Home > Web Front-end > JS Tutorial > Introduction to three methods of returning to the previous page in JavaScript and their differences_javascript skills

Introduction to three methods of returning to the previous page in JavaScript and their differences_javascript skills

WBOY
Release: 2016-05-16 15:51:26
Original
1388 people have browsed it

JavaScript returns to the previous page code difference:

window.history.go(-1);  //返回上一页
window.history.back();  //返回上一页
//如果要强行刷新的话就是:window.history.back();location.reload();

window.location.go(-1); //刷新上一页
Copy after login
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