KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a Backbone Router set up that seemingly works - the routes get triggered properly, the views update, etc. However, when I press the browser's "Back" button, the routes aren't triggered at all. Also, typing in a URL into the browser doesn't trigger the routers either. Is there some step I'm missing to bind the browser specific things to Backbone (Firefox 11). Setup var messageRouter = new MessageRouter({view: messageListView}); Backbone.history.start(); Trigger Backbone.history.navigate("#/view/" + $(this).data("filter-type"), {trigger: true}); Router Code var MessageRouter = Backbone.Router.extend({ view : null, /* should always be overridden */ initialize : function(options) { this.view = options.view; }, routes : { "" : "default", "/view/:filter" : "filter", "camera" : "camera" }, default : function() { }, filter : function(filterString) { this.view.setFilter(filterString); this.view.rerender(); }, camera : function(cameraString) { } });
Tags (comma-separated)
Save Edits
Cancel