When does document.ready actually fire?

后端 未结 4 738
野性不改
野性不改 2020-12-11 02:38

Let\'s consider the following case:

There is a 2.5MB image in an tag and I\'m on a slow connection which takes considerable time to download

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 03:07

    $(document).ready(...)
    

    Fire when the DOM is loaded (even if multimedia no loaded yet)

    $(window).load(...)
    

    Fire when all the content is loaded (when the progress indicator which shows the loading process is gone)

提交回复
热议问题