Different uses of $(document).ready
<p>What is the difference/advantages of using the $(docu...) with your variables and functions defined inside, from using it with a function and then calling it inside the $(docu...)</p>

<pre><code>$(document).ready(function (){
    initialize();
});
function initialize(){
    hello
}
</code></pre>

<p>over using this:</p>

<pre><code>$(document).ready(function (){
        hello
});
</code></pre>
