I have a function that removes hash from the URL using this code:
window.location.href = window.location.href.split('#')[0];
The function is triggered by either clicking a certain page element or by pressing the ESC key. Both work perfectly in Chrome, but in Firefox, the ESC key does not remove the hash, while pressing the page element does. I've tried other ways of removing the hash part, such as
location.href.replace(location.hash,"")
but with the same result. I know that the function IS triggered by the ESC key in FF, since other code inside it (such is hiding an overlay) executes successfully. Any ideas would be appreciated.