What is the difference between document ready and window onload?

In Jquery, we can see two ways of writing: $ (function () {}) and $ (document) .ready (function () {}), both execute a function
window.onload after the dom document tree is loaded A function
is executed after the dom document tree is loaded and all files are loaded, that is, $ (document) .ready is executed before window.onload.

 

Published 203 original articles · praised 8 · 10,000+ views

Guess you like

Origin blog.csdn.net/z591102/article/details/105532930