jQuery question: what does it really mean?

后端 未结 5 1349
北海茫月
北海茫月 2020-12-01 07:03
(function($, window, undefined){
  ... jquery code... 
})(jQuery, window);

What does it really mean? Does it also mean $(document).ready()

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 07:34

    (function($, window, undefined){
      ... jquery code... 
    })();
    

    is different than

    $(document).ready() 
    

    Paul Irish has a good video on 10 Things I Learned from the jQuery Source at 1:30 in he talks about the jquery source's self executing anonymous function and what the arguments mean

提交回复
热议问题