Hello, I am trying to handle back button on my page so a function would be called whenever I press the button. I dynamically set the "location.hash" value on the page. I was hoping to achieve the functionality by onBeforeUnload, but it does not react on change of hash value in url – it just reacts on changing url address.
Is there any other way? For example I am trying to achieve the functionality like in gmail, when back button pressed.