Skip to content

Instantly share code, notes, and snippets.

@karloscarweber
Created October 24, 2013 16:30
Show Gist options
  • Save karloscarweber/7140427 to your computer and use it in GitHub Desktop.
Save karloscarweber/7140427 to your computer and use it in GitHub Desktop.
All th ways to make a document.ready() event listener for Jquery. see: http://api.jquery.com/ready/ I've had to look this up enough times that I decided to store it somewhere. I don't know why I always forget
/*Classic way*/ // $( document ).ready( handler )
$( document ).ready( function( ) {
// do something.
} )
/* Short Way */ // $( handler )
$( function( ) {
// do something
})
// personally I prefer the short way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment