HASHES

Bad:

 <a href="#">Hahaha let's clear the hash fragment that'll be fun!</a>

Good:

 <a href="javascript:void(0);">Nobody will get hurt this way.</a>

Re-triggering Routes

       Backbone will try to outsmart you...
       Navigate only gets called when the hash is different.
// dummy navigate, clear the hashrouter.navigate('', {trigger: false, replace: true});
// the real navigationrouter.navigate('/real/route', {trigger: true});

Use Modules

Break your code up into chunks! (plz)

Modules live outside of Applications

  • Start/stop them independently from your app
  • Additional (useful) events: "start" and "before:start"
  • This makes unit testing easier/possible
  • More encapsulation, more better

HASHES

By Eric Wood