强制应用程序刷新后退按钮

发布于 2024-08-05 13:54:24 字数 234 浏览 3 评论 0原文

我有一个网络应用程序,可以在页面加载后通过 ajax 提取信息。当用户离开页面,然后点击浏览器中的“后退”按钮时,他们会看到页面在初始加载时的样子。我需要发生的是让所有 javascript 运行,就像它们点击“刷新”按钮一样。

我尝试设置 Cache-Control 和 Pragma 标头,但这没有帮助。我知道这是可能的,因为谷歌在他们的许多应用程序中都这样做了,例如 gmail 和谷歌阅读器。有什么想法吗?

谢谢!

I have a web app which pulls in information via ajax after the page loads. When a user leaves the page, then hits the 'back' button in their browser, they see the page as it looked on initial load. What I need to have happen is have all javascript run as if they hit the 'refresh' button.

I have tried setting the Cache-Control and Pragma headers, but this didn't help. I know this is possible, as Google does it in many of their applications, such as gmail and google reader. Any ideas?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十级心震 2024-08-12 13:54:24

看一下 Really Simple History - 它是一个 JavaScript 库,可让 AJAX 应用程序与后退和前进按钮使用与 Gmail 和家庭使用的相同技术。

Have a look at Really Simple History - it's a JavaScript library that lets AJAX applications interact with the Back and Forward buttons using the same techniques that Gmail and family use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文