+ 1
Window.onload function
Can someone explain what is this function( window.on load). It's use and function and when it is to be used?
2 ответов
+ 7
The onload event triggers when the window object has been loaded.
For more details you can refer to the MDN:
https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event
https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
+ 4
window.onload is an event which activate when html content downloaded .
Generally used here in sololearn to solve refrence error.as
window.onload = ()=>{
//Js code
}
Mean run my js code after loading html