Skip to content

Instantly share code, notes, and snippets.

@manjufy
Created April 14, 2016 09:47
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 manjufy/b7655b51d4830d2e6f67d6b71e1ee7a5 to your computer and use it in GitHub Desktop.
Save manjufy/b7655b51d4830d2e6f67d6b71e1ee7a5 to your computer and use it in GitHub Desktop.
Ways to Initialise Jquery
// Below one, runs the function when the DOM tree is built
$(document).ready(function({
// Codes goes here
});
$(function() {
// Codes goes here
});
// Runs the funciton right away
(function($){
// code
})(jQuery)
// same as
jQuery(function($) {
// Codes goes here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment