ready vs onload

1 ready event: when the DOM is ready, you can query, bind a function to be executed when the manipulation. It can greatly improve the response speed of the web application.

2 onload event: js method in all elements of the page, the picture is fully loaded before executing this event handler is relatively slow.

Guess you like

Origin www.cnblogs.com/SallyShan/p/11488901.html