强制应用程序刷新后退按钮
我有一个网络应用程序,可以在页面加载后通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下 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.