Search code examples
javascriptbackbone.jsrouterbackbone-routing

Exclamation Mark in Backbone Router routes


In our project we have a bunch of routes such that the original route: routeAction is followed by !route: routeAction like so..

'home': 'homeAction',
'!home': 'homeAction',

No one on the team knows why we do this. Anyone here know? Can't find anything in the documentation about it.


Solution

  • Adding that exclamation mark (!) has nothing with backbone that's why you can't find anything in the doc about it Backbone treats it like any usual URL.
    But If the project is a little bit too old I think this was used to let google crawl that ajax content this way accessing the route with ! will stay valid and calls the appropriate handler.