title: jQuery document.ready vs self calling anonymous function
body: <p>What is the difference between these two.</p>
  
  <ol>
  <li><p><code>$(document).ready(function(){ ... });</code></p></li>
  <li><p><code>(function(){ ... })();</code></p></li>
  </ol>
  
  <p>Are these both functions called at the same time?
  I know, document.ready will be triggered when the entire HTML page is rendered by the browser but what about 2nd function (self calling anonymous function). Does it wait for browser to complete rendering the page or it is called whenever it is encountered?</p>