How to capture browser's back/forward button click event or hash change event in javascript?
- 阅读更多 关于 How to capture browser's back/forward button click event or hash change event in javascript?
I want to alert() when browser's back or forward button is clicked or hash is changed in javascript. I have tried this solution and it is working but it is causing problems on other links in webpage and submit each request twice on any link click event. Is there any solution to capture it without using setInterval() function? So I need to capture hash change or back/forward button click event? I need a simple javascript code/function/property that should work in all modern browsers. Any solution ? Thanks Robert Koritnik Not a good idea Can you rather explain the reasoning behind this? We've