1、几种方法:
window.history.go(-1); //返回上一页
window.history.back(); //返回上一页
//如果要强行刷新的话就是:window.history.back();
//刷新当前页 window.location.reload();
window.location.go(-1); //刷新上一页
2、获取浏览器纪录
window.history
输出:
History {length: 4, scrollRestoration: "auto", state: {…}}length: 4scrollRestoration: "auto"state: {key: "10549.050"}key: "10549.050"__proto__: Object__proto__: History