laurnts
11/8/2013 - 9:43 AM

jQuery Document Ready

jQuery Document Ready

jQuery(); // What jQuery does is calling a function. jQuery library contains defined functions.

jQuery(function(){}); // When defining a function, it needs 2 brackets (arguments list) and {commands}

jQuery(function(){ // So now you are a calling a function inside a function
});

jQuery(function($){ // By placing a '$' sign, you're renaming the jQuery function into what every you want which is '$'
    $('selector').click(); // So the '$' returns jQuery, hence function (jQuery) call function ($) call click() function.
}); // function call a function, call a function, call a function.

// So This is jQuery Shorthand
jQuery(function(){ [commands] });
<script type="text/javascript">
    jQuery(document).ready(function(){
        [code]
    });
</script>