问题
it's a bit of a nooby question, but there it goes:
i have a site where the user can only navigate from page to page via next and back buttons. i.e there is a wizard the user must follow. part of the wizard includes different pages and part includes the same page but with changing divs (but from user experience its a different page).
i would like to simply redirect the user to the first page of the wizard, whenever he clicks on the browser's back button.
if possible and simple, i prefer doing so without the use of (yet another) plugin.
thanks.
回答1:
It's not possible to prevent the default behavior of the browser's back button - no browser allows that because it would pose potential security risks and a bad user experience.
With that said, there are tricks out there that may satisfy your needs.
Check this out:
Detecting Back Button/Hash Change in URL
来源:https://stackoverflow.com/questions/6830687/redirecting-to-a-specific-page-when-clicking-browsers-back-button