Difference between onload() and $.ready?

前端 未结 6 1568
灰色年华
灰色年华 2020-11-28 05:17

Can you list the difference between onload() and $(document).ready(function(){..}) functions in the using jQuery?

6条回答
  •  离开以前
    2020-11-28 05:24

    Onload take care about DOM and resources: it checks if images are loaded, script are ready to run and much more.

    $.ready simply check if we have read the full DOM of the page.

    Please check out this link for more explain and example: http://dailygit.com/difference-between-document-ready-and-window-load-in-jquery/

提交回复
热议问题