我有
var Router1 = Backbone.Router.extend({
routes: {
'': 'index',
'view': 'view1'
}
});
var router1 = new Router1();
router1.on('route:index', function(){
alert('Index Page');
});
router1.on('route:view1', function(){
alert('View 1');
});
以下网址不做任何事情
http://localhost:8080/App1/index.html /*should give alert('Index Page')*/
http://localhost:9090/App1/index.html#view /*should give alert('View1')*/