As can be seen in the documentation (http://www.asual.com/jquery/address/docs/), the plugin has an event to detect when the back/forward button of the browser was pressed.
$.address.externalChange(fn)
My question is if there is a way to know when the back is pressed and when the forward is pressed. For example, this will work in both cases:
$.address.externalChange(function() { console.log('back/forward pressed'); });
Thanks.
To my knowledge, no history plugin can detect which browser button exactly has been pressed.
The best you can do is keep a history of visited pages, then check if the new page is further back in the history than the current one. When pages are revisited without the back/forward button, you'll probably get wrong results with below code.
Untested example code: