Reputation: 2693
I am creating an application which has a requirement of refreshing the browser whenever we click back button to try to go back to some other page.
How can i do that ? Is there any way to catch the back button event ?
Thanx in advance..
Upvotes: 0
Views: 1951
Reputation: 5875
If you implement the HTML5 History
interface, you can react to onpopstate
and then just reload()
the page.
Upvotes: 1
Reputation: 32980
You can try to use the popstate event:
window.onpopstate = function(event) {
window.location.reload();
};
Upvotes: 0