骨干路由器不工作(没有参数)

时间:2015-09-19 10:29:00

标签: javascript backbone.js

我有

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')*/

0 个答案:

没有答案