$(document).ready or $(function(){}): Which way is the correct one?
<p>I'm using <strong>jQuery</strong> to run my code after the DOM is ready and I've been using the following idiom</p>

<pre><code>jQuery(function(){
    //my code
});
</code></pre>

<p>but in many places I've seen people doing</p>

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

<p>What's the difference between the two? If nothing, then why do most people use the second way?</p>
