What is the difference between $(document).ready(function() and $(function() ?
<p>So I know what this does:</p>

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

<p>Now I have seen people doing this lately:</p>

<pre><code>&lt;script type="text/javascript"&gt;     
$(function(){
    // Your code here...
});
&lt;/script&gt;
</code></pre>

<p>Are these two ways of doing the same thing?</p>

<p>I see an anonymous function being declared inside a jquery selector here, but never actually being invoked, yet by the way the page runs it seems that this may just run on pageload.</p>
