我需要一个面向客户的路线解决方案,以便与一套神学仪合作。 I ve researched several and Crossroads.js 看起来好像是好的。 当我把它列入我的html档案时,它似乎不可行,也就是说,如果我使用像象法典一样的法典的话。
crossroads.addRoute( /news/{id} , function(id){
alert(id);
});
crossroads.parse( /news/123 );
, the page alerts 123 but if I type /news/321 in the browser s url bar, it preforms the browser s default action, instead of alerting 321 . What am I doing wrong. (Also, I realize the title is broad, but I believe the difficulties I m having with crossroads.js are more general than crossroads.js in particular. It is given as an example.)