what exactly document-ready means in jquery

前端 未结 3 1772
天命终不由人
天命终不由人 2020-12-18 10:46

Let us say I have a HTML page that contains a javascript file:

The base.js is like this:

$(document).ready(function () {
   obj.init();
}

// .....         


        
3条回答
  •  再見小時候
    2020-12-18 11:42

    You should define obj before referencing it.

    Also, document.ready doesn't mean that the resources will be loaded, only that the document been parsed, so the resources load between document ready and the $(window).load event.

提交回复
热议问题