Tag Archives: The front frame

The difference between onready or $() and onload

1. Onready or $() is executed before onload

2. Onready or $() is executed after page parsing, while onload is executed after all elements of the page are loaded

3. Onload only executes the last one, while onready or $() can execute multiple

 

One is the different times, $(). Ready() can be used many times in an HTML, onload can only be used once, or the only valid binding.

The other is the timing of execution. In short, $() is executed earlier than onload, because $() is executed as long as the DOM tree is loaded, and onload is executed when all elements are loaded.