how did jquery implement $(document).ready()?

前端 未结 3 1864
花落未央
花落未央 2021-02-03 13:01

how did jquery implement $(document).ready()?

of course I can read the code, but I am looking for the concept...

3条回答
  •  春和景丽
    2021-02-03 14:03

    In general, It checks if the browser already loaded the body element to the DOM tree, in that case it executes the cb() without waiting for the other requests(images...)

    otherwise it waits sometime and recheck..

提交回复
热议问题