以下是 $(document).ready
的简写吗?
(function($){
//some code
})(jQuery);
我看到这种模式被大量使用,但我找不到任何关于它的引用。如果它是 $(document).ready()
的简写,是否有任何特殊原因可能无法正常工作?在我的测试中,它似乎总是在 ready 事件之前触发。
最佳答案
简写为:
$(function() {
// Code here
});
关于javascript - $(document).ready 简写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6004129/