Skip to content

Instantly share code, notes, and snippets.

@tammersaleh
Created November 17, 2009 19:48
Show Gist options
  • Save tammersaleh/237208 to your computer and use it in GitHub Desktop.
Save tammersaleh/237208 to your computer and use it in GitHub Desktop.
ready: function(fn) {
// Attach the listeners
bindReady();
// If the DOM is already ready
if ( jQuery.isReady )
// Execute the function immediately
fn.call( document, jQuery );
// Otherwise, remember the function for later
else
// Add the function to the wait list
jQuery.readyList.push( fn );
return this;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment