Reload the page when user clicks the browser BACK or FORWARD buttons

The popstate event will be triggered by doing a browser action such as a click on the back or forward button (or calling history.back() or history.forward() in JavaScript).
JavaScript


window.addEventListener('popstate', function () {
	location.reload();
});

Written by fbrefere001

Posted by fbrefere001 on Wednesday July 3, 2019