I'm using Backbone inside a PhoneGap application. Like every mobile app I need a back-button functionality. It's basically working perfectly with Backbone, because I can simply use window.history.back()
and it just works.
The only problem I have is to decide when to display the back button. Using window.history.length
does not work, because it's not decremented when using back()
(of course, because you can go forward()
as well).
Is there any way to detect if there's more history or if I'm already at the bottom of the stack? Since the browser doesn't seem to supply this info (How to check if the user can go back in browser history or not) does Backbone keep track of this maybe?