I have two customized functions that handle back and forward page. I need to call them when user clicks on the browser back/forward buttons too.
window.onpopstate = function() {
if ( /* back button clicked */ ){
showPreviousPage():
} else {
showNextPage();
}
})
How can I implement that condition? In other word, how can I detect browser back button is clicked?