I think you mean like this:
$(function() { ... });
This is a shorthand for:
$(document).ready(function() { ... });
What he does is register a handler for the ready event, so the code in the function will be launched immediately after loading the document.
Guffa
source share