Skip to content

Instantly share code, notes, and snippets.

@madrobby
Created May 9, 2011 01:33
Show Gist options
  • Save madrobby/961889 to your computer and use it in GitHub Desktop.
Save madrobby/961889 to your computer and use it in GitHub Desktop.
// routes = [ [/test/, function(url){ console.log(url) }], ... ]
setInterval(function h(r){if(h.l!==(h.l=location.hash))for(r in routes)routes[r][0].test(h.l)&&routes[r][1](h.l)},10);
@danbeam
Copy link

danbeam commented May 9, 2011

^^ Yeah, but that's gross, :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment