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