Skip to content

Instantly share code, notes, and snippets.

@gdiggs
Created June 15, 2011 22:17
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 gdiggs/1028275 to your computer and use it in GitHub Desktop.
Save gdiggs/1028275 to your computer and use it in GitHub Desktop.
top down shit
$('form').live('submit', submitForm(e, $(this)) );
var submitForm = function(e, $form) {
e.preventDefault();
// make sure we want to do shit
doShit();
// stuff we do after doing shit
};
var doShit = function() {
$.ajax({
// some data
success: shitSuccess()
});
};
var shitSuccess = function() {
// fuck yeah
};
@modality
Copy link

this is some good shit

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