Home > Article > Web Front-end > The difference between $(document).ready() and window.onload in jquery_jquery
So if a certain image or other resource takes a long time to load, the visitor will see an incomplete page, or even a script that relies on dynamically added elements will be executed before the image is loaded, resulting in a script error.
window .onload = function() { testDiv.innerHTML = "