浏览器不记得最后一次查看的页面位置 [英] Browser does not remember position of page last viewed

查看:207
本文介绍了浏览器不记得最后一次查看的页面位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了针对此问题的一些搜索和我已经拿出空手而归。我希望有人能澄清事情对我和我指出了正确的方向。

I have done a few searches for this issue and I have come up empty handed. I hope somebody can clarify things for me and point me in the right direction.

问题:我有提交搜索表单后,显示结果列表的页面。当用户点击的结果之一,浏览器去显示有关结果的更多信息了新的一页。当用户随后点击返回按钮进入包的结果,我的浏览器重新加载页面,并显示网页,而不是上次结果的顶部点击。

Problem: I have a page that displays a list of results after submitting a search form. When a user clicks on one of the results, the browser goes to a new page showing more information about the result. When the user then clicks the 'back' button to go pack to the results, my browser reloads the page and shows the top of the page instead of the result that was last clicked.

目标:我想是这样的:当用户点击的后退按钮,浏览器应该回到previous页,而不是显示在页面的顶部,显示在previous位置的页面。

Goal: What I would like is this: when the user click's the back button, the browser should go back to the previous page and, instead of showing the top of the page, show the page at the previous position.

解决方案:我完全失去了,因此这个结果是如何实现的。难道有事情做与JavaScript,或者发送到浏览器的标题,也许是与缓存。

Solution: I am completely lost as how this result can be achieved. Could it have something to do with javascript, or headers sent to the browsers, maybe something to do with caching.

推荐答案

我用PHP发送头修复了这个问题。这是我的解决方案:

I fixed this issue by sending headers with php. This was my solution:

header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: store, cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", FALSE);

感谢大家的帮助。

Thanks to everybody for the help.

这篇关于浏览器不记得最后一次查看的页面位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆