I have a working app using Backbone 0.5.3, which is no longer working using backbone 0.9.2.
I identified that Router.navigate() doesn't call my route for some reason.
Here's my Router:
var Router = Backbone.Router.extend({
routes: {
'/mypage': 'mypage',
},
mypage: function() {
// show page ...
}
});
Calling the route manually like so works fine:
Router.mypage()
I also tried to overwrite backbone's .navigate method to debug my app ...
var Router = Backbone.Router.extend({
routes: {
'/mypage': 'mypage',
},
navigate: function(fragment, options) {
console.log("navigate called");
Backbone.history.navigate(fragment, options);
},
mypage: function() {
// show page ...
}
});
... it seems that .navigate is called but ...
Backbone.history.navigate(fragment, options);
... just doesn't call the route.
I'm using PushState, here's my initial call:
Backbone.history.start({
root: '/',
pushState: true,
silent: true
});
Already tried it without the root and silent parameters - no success.
Again: This works using Backbone 0.5.3.
Thanks to everyone leaving a reply!
Achim