I’d like to call Backbone’s router.navigate and have it update the hash fragment only, even in browsers that do support the History API. Is this possible?
For example, say I have the call:
router.navigate("page/" + pageNumber);
I’d like this to go to #page/14 even in browsers that do support the History API and are theoretically capable of navigating to /page/14.
Is there an option I can set to call this? Alternatively, I guess I can just update location.hash manually, but I would prefer to do things through Backbone if possible.
Thanks!
Replacing your Backbone.History.start() with this :
Will make your Backbone application with hashes. But you’ll need to add “/#/page/14” to every href of your links, to make this work!