How to bind the event of clicking the back button in a browser to a specific function (for all the browsers)?
I have got two scenarios:
user accesses to page A; then click on a link to go to page B; click back button to go back to page A;
user accesses to page A; then click on a link to go to page B; click on another link to go to page A;
I need a particular behavior to happen when the user is back to page A clicking the back button. Is that any way to do that in all the browsers. If I bind a function to "beforeunload" event in page B, the event is triggered in whate开发者_C百科ver way I am leaving the page.
I had almost the exact same question I think this is what you need https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
精彩评论