Skip to content

Instantly share code, notes, and snippets.

@rootscript
Last active August 29, 2015 14:16
Show Gist options
  • Save rootscript/1ac7f0162cb39f6e6d8e to your computer and use it in GitHub Desktop.
Save rootscript/1ac7f0162cb39f6e6d8e to your computer and use it in GitHub Desktop.
--jQuery: Template siaf self-invoking-anonymous-function
(function() {
})();
@rootscript
Copy link
Author

Should be used when running scripts before </body>,
when responding to events etc... so that page loads quicker.

As opposed to using (in the header):

$(document).ready(function() {

})

When the DOM is ready to be manipulated, execute this callback function.

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