When does $(document).ready() fire?

前端 未结 5 1776
栀梦
栀梦 2020-12-30 13:58

The comments from this question got me thinking about something. When exactly does the $(document).ready() function fire? The obvious answer would be \"when the

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-30 14:22

    According to the jQuery site, $( document ).ready() will only run once the page Document Object Model (DOM) is ready for JavaScript code to execute.

    Reference: http://learn.jquery.com/using-jquery-core/document-ready/

提交回复
热议问题