Is the following shorthand for $(document).ready
?(以下是$(document).ready
简写吗?)
(function($){
//some code
})(jQuery);
I see this pattern used a lot, but I'm unable to find any reference to it.(我看到这种模式使用了很多,但我找不到任何引用。) If it is shorthand for $(document).ready()
, is there any particular reason it might not work?(如果它是$(document).ready()
简写,是否有任何特殊原因可能无效?) In my tests it seems to always fire before the ready event.(在我的测试中,似乎总是在准备好的事件之前开火。)
ask by Mark Brown translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…