I create a test case with backbone.js @: http://jsfiddle.net/VWBvs/5/
Route is defined as
var AppRouter = Backbone.Router.extend({
routes: {
"/posts/:id" : "getPost",
"/download/*path": "downloadFile",
"*actions" : "defaultRoute"
},
getPost: function(id) {
alert(id);
},
defaultRoute : function(actions){
alert(actions);
},
downloadFile: function( path ){
alert(path); // user/images/hey.gif
},
loadView: function( route, action ){
alert(route + "_" + action); // dashboard_graph
}
});
var app_router = new AppRouter;
Backbone.history.start();
When I change the function
defaultRoute : function(actions){
alert(actions);
},
to
defaultRoute : function(actions){
var action = actions
},
all other routes won't work which means no dialog pops up.
But when rechange the code ,all is ok.
It's really weird and make me confused. SOS sincerely ......