admin管理员组文章数量:1430358
How do I insert an entry into browsing history so back button goes to different page 1st click then original page on 2nd click?
So if you need a good explanation of what I want done, go to: .jsp
I just need a script that will allow me to insert an entry in the browsing history so when back button is hit, the user will be taken to my special page.
How do I insert an entry into browsing history so back button goes to different page 1st click then original page on 2nd click?
So if you need a good explanation of what I want done, go to: https://secure.exitjunction./howitworks.jsp
I just need a script that will allow me to insert an entry in the browsing history so when back button is hit, the user will be taken to my special page.
Share Improve this question edited Apr 16, 2009 at 0:25 Diodeus - James MacFarlane 114k33 gold badges163 silver badges180 bronze badges asked Apr 16, 2009 at 0:02 SkySky 2034 silver badges7 bronze badges2 Answers
Reset to default 3Here is a link to a jQuery Plugin:
jQuery Plugin
You can't directly manipulate the browsing history.
Such a feature would be seen as a security hole (and it would be), so I doubt that any browsers would ever implement it.
You might be able to hack around it however by doing something like this:
NOTE: This entirely hinges around the assumption that the referrer will get changed by the back button. I don't think this actually happens, so it more than likely won't work, but hey.
You have two pages, PageA and PageB.
- The user hits PageA
- The page (on the client, using javascript) checks the HTTP referrer, and if it is not PageB, then it immediately redirects the user to PageB.
- Now that you're on PageB, if the user clicks the back button, it will go back to PageA.
- PageA will check the referrer, it
willmay be PageB, so there is no redirect.
本文标签: back buttonHow do I insert an entry into browsing history via JavaScriptStack Overflow
版权声明:本文标题:back button - How do I insert an entry into browsing history via JavaScript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745482534a2660240.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论