Skip to content

Instantly share code, notes, and snippets.

@ianb
Created May 18, 2010 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianb/405511 to your computer and use it in GitHub Desktop.
Save ianb/405511 to your computer and use it in GitHub Desktop.
var app = $.sammy(function () {
this.element_selector = '#body';
this.get('#/', function (context) {
... stuff to do for the URL /#/ ...
});
this.get('#/view/:id', function (context) {
... stuff for e.g., /#/view/10 ...
... use this.params.id to get "10" ...
});
});
$(function () {
app.run('#/');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment