What is the difference between these jQuery ready functions?

后端 未结 9 1511
名媛妹妹
名媛妹妹 2020-11-22 15:31

what is difference between

$(function(){

}); 

and

$(document).ready(function() { 

});
9条回答
  •  [愿得一人]
    2020-11-22 15:49

    $(function(){}) is a short cut for the dom ready

    A function passed as an argument to the jQuery constructor is bound to the document ready event.

提交回复
热议问题