Stack Overflow has several questions related to detecting back button presses, the most relevant one being a list of libraries for doing exactly that:
https://stackoverflow.com/questions/116446/what-is-the-best-back-button-jquery-plugin
The problem is, when I tried using libraries from that thread (and elsewhere) they all either:
- didn't work (anymore; they must have worked once)
- didn't support IE8
- broke Backbone's router
The problem seems to be that Backbone's router watches for hashchange events, and so do these other libraries, and they do so in a way which affects Backbone's Router (eg. one made the back button completely stopp working).
So, my question is, does anyone know of a way to detect back-button presses, that works in IE8+, which (and this is the key part) doesn't break the Backbone Router?
Or failing that, can anyone even explain or point me to an explanation of how to implement back-button-prevention myself on a Backbone.Router-powered site?