admin管理员组文章数量:1320670
Client is asking for the ability for users to go back to a page full of search results after clicking on a result. Right now it's a simple jQuery call:
$('a.detail-back-button').on('click', function(evt) {
evt.preventDefault();
window.history.back();
});
This shows a "Document Expired" page in Firefox, however. I know it's there for security, but the client wants this implemented anyways. I've done some searching around and I've found a php solution to the problem...
session_cache_limiter('private_no_expire')
...but this is a Django-based web site. Are there any other solutions?
UPDATE 02/21/13
The solution below works but only for browsers that aren't IE. IE8/9/10 doesn't seem to re-request the previous page. Is there an IE workaround?
Client is asking for the ability for users to go back to a page full of search results after clicking on a result. Right now it's a simple jQuery call:
$('a.detail-back-button').on('click', function(evt) {
evt.preventDefault();
window.history.back();
});
This shows a "Document Expired" page in Firefox, however. I know it's there for security, but the client wants this implemented anyways. I've done some searching around and I've found a php solution to the problem...
session_cache_limiter('private_no_expire')
...but this is a Django-based web site. Are there any other solutions?
UPDATE 02/21/13
The solution below works but only for browsers that aren't IE. IE8/9/10 doesn't seem to re-request the previous page. Is there an IE workaround?
Share Improve this question edited Feb 21, 2013 at 22:13 Don asked Feb 19, 2013 at 19:25 DonDon 2755 silver badges14 bronze badges1 Answer
Reset to default 7This has to do with the by definition non-idempotent nature of POST
ed requests. I.e. a POST
is an action which has an effect, and is thus unsafe to repeat. To prevent this from happening accidentally, some browsers show a placeholder page with a confirmation message before resubmitting the original form.
The most reliable solution -possibly the only one- is to submit your form using the GET
method instead, which makes sense anyway.
本文标签:
版权声明:本文标题:javascript - window.history.back() shows "Document Expired" page, any way around that? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742063736a2418705.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论