我正在看一段代码:
(function($) {
// other code here
$(document).ready(function() {
// other code here
});
})(jQuery);
Run Code Online (Sandbox Code Playgroud)
我虽然IIFE执行$(document).ready的功能,这段代码是否正确?或者我可以删除$(document).ready并将代码直接放在IIFE中.