问题
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