これらのjQuery対応関数の違いは何ですか? 質問する

これらのjQuery対応関数の違いは何ですか? 質問する

違いは何ですか?

$(function(){

}); 

そして

$(document).ready(function() { 

});

ベストアンサー1

何もないです。

この関数は$(document).ready()と同じように動作し、他の$()をラップするために使用します。

これは、ソースコード:

rootjQuery = jQuery(document);

...

} else if ( jQuery.isFunction( selector ) ) {
    return rootjQuery.ready( selector );
}

おすすめ記事