Skip to content

Instantly share code, notes, and snippets.

@quirkey
Created December 13, 2010 05:19
Show Gist options
  • Save quirkey/738686 to your computer and use it in GitHub Desktop.
Save quirkey/738686 to your computer and use it in GitHub Desktop.
the original sketch for sammy.js
// example app
(function($) {
get('#/path', function() {
this // == Request object
this.params //query string params as JS object
redirect('/path2'); //redirects
render('text'); //replaces specified area or body
});
get('/path/:id', function(id) {}); // matches /:id and sends as arg to function
post('/path', function() {}); // all forms are disabled and submits are watched for and passed to post/put
clicked() // events are also bound
helpers(function() {
}); // methods are defined with in the apps namespace
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment