What is the difference between these two javascript functions ?

Posted by neilc on Stack Overflow See other posts from Stack Overflow or by neilc
Published on 2010-05-18T10:35:22Z Indexed on 2010/05/18 10:40 UTC
Read the original article Hit count: 224

Filed under:
|
|

I've been looking at how some jQuery plugins work and I've seen the following acting as a closure around the whole plugin

$(function(){
    // plugin code here

});

(function($){
    // plugin code here

})(jQuery);

What is the difference between these two ?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery