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
WBOYOriginal
2016-05-16 15:51:261389browse

JavaScript returns to the previous page code difference:

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

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