JavaScript / jQuery closure function syntax
<p>Can someone please explain the differences between the following functions:</p>

<pre><code>(function($){
  // can do something like 
  $.fn.function_name = function(x){};

})(jQuery);
</code></pre>

<p>Could I use jQuery in the next function?</p>

<pre><code>(function(){

}());
</code></pre>

<p>And is the following the same as jquery.ready()?</p>

<pre><code>$(function(){

});
</code></pre>

<p>Thanks!</p>
