【问题标题】:Chrome 41: Force Reload when pressing the back button [duplicate]Chrome 41:按下后退按钮时强制重新加载[重复]
【发布时间】:2015-05-20 08:41:16
【问题描述】:

我正在尝试类似的东西:Force reload/refresh when pressing the back button

很遗憾,建议的代码在 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();
}};

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

非常感谢!

【问题讨论】:

标签: javascript jquery browser-history page-refresh


【解决方案1】:

check this question 使用 localStorage/sessionStorage 解决问题。

【讨论】:

  • 这行得通 - 非常感谢!
猜你喜欢
  • 2012-02-22
  • 2021-07-01
  • 1970-01-01
  • 1970-01-01
  • 2016-03-18
  • 2014-02-17
  • 1970-01-01
  • 2016-09-19
  • 2010-12-26
相关资源
最近更新 更多