Chrome 41:按下后退按钮时强制重新加载

Chrome 41: Force Reload when pressing the back button

本文关键字:新加载 加载 按钮 Chrome      更新时间:2023-09-26

我正在尝试类似的操作:按下后退按钮时强制重新加载/刷新

不幸的是,建议的代码在Chrome 41:中不起作用

window.onpageshow = function(evt) {
// If persisted then it is in the page cache, force a reload of the page.
if (evt.persisted) {
    document.body.style.display = "none";
    location.reload();
}};

这个问题有新的解决方案吗?

非常感谢!

请检查使用localStorage/sessionStorage解决问题的问题。