Controlling the behavior of the Browsers Back Button

↘锁芯ラ 提交于 2019-12-08 13:44:48

问题


We created an E-Newsletter for a client that includes lots of story links as well as banner adds. The majority of users are reading the newsletter in MS Outlook. The client thinks users will get confused when they click on a link from the newsletter and it opens in their browser and then the user can't hit the browser's back button in order to get back to the newsletter.

What are my options? Is it possible to control where the Browsers back button takes the user? I would guess not for security reasons.

If I have the newsletter links go through our main site and then redirect to the desired page (story or ad), can I do it in such a way that the back button will work and won't result in the user being redirected back to the redirect page?

Is there a better approach?


回答1:


Overall, the back and forward buttons step the user through the history and for security reasons, there is very little you can do about that. But ...

You do have a certain amount of control over the history. In particular, page 1 can say "go to page 2", and once the user is on page 2, the back button will return the user to page 1 OR page 1 can say "replace me in history with page 2"; then once the user is on page 2, the back button will return the user whatever was before page 1, if anything. This is a good way to Orwell redirect pages right out of memory.

See here for details.



来源:https://stackoverflow.com/questions/6541726/controlling-the-behavior-of-the-browsers-back-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!