Skip to content

Instantly share code, notes, and snippets.

@travhimself
Created May 27, 2012 20:36
Show Gist options
  • Select an option

  • Save travhimself/2815834 to your computer and use it in GitHub Desktop.

Select an option

Save travhimself/2815834 to your computer and use it in GitHub Desktop.
js jquery blocks
$(document).ready(function() {
// fire when the DOM is ready
});
$(window).load(function() {
// fire after page has been rendered
});
$(window).unload(function() {
// fire when user leaves the page
});
$.fn.newFunc = function() {
// new jquery function
};
$('a').click( function(e) {
e.PreventDefault();
// new click event
});
var newFunc = function() {
// new js function
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment