Chrome 41: Force Reload when pressing the back button [duplicate]

核能气质少年 提交于 2021-02-10 19:35:30

问题


I'm trying something similar to this: Force reload/refresh when pressing the back button

Unfortunately, the suggested code doesn't work in 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();
}};

Is there a newer solution to this problem?

Thanks a lot!


回答1:


Please check this question that addresses the problem using localStorage/sessionStorage.



来源:https://stackoverflow.com/questions/29107229/chrome-41-force-reload-when-pressing-the-back-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!