I want to be able to add certain behavior when a user clicks browser "back" and "forward" buttons.
Is there a way to say with JavaScript something like this:
backButton.onclick = function() {
// do something
}
forwardButton.onclick = function() {
//do something else
}
Is there a way to do that directly with JavaScript, without relying on any plugin?