I need a client-side routing solution for working with a chrome application. I have researched a few and crossroads.js seems appropriate. When I include it in my html file, it does not seem to work; that is, if I use code like
crossroads.addRoute('/news/{id}', function(id){ alert(id); }); crossroads.parse('/news/123');
the page notifies '123', but if I type '/ news / 321' in the browser url line, it will transform the default action for the browser, rather than warning '321'. What am I doing wrong. (In addition, I understand that the name is broad, but I believe that the difficulties that I have with crossroads.js are more general than crossroads.js in particular. This is given as an example.)
javascript client-side url-routing
danwoods
source share