I'm looking through some code from GitHub and I can't seem to figure out why this line of code is there, nor can I find anything about it online.
window.addEventListener("load", function() {
What does "load" do?
I'm looking through some code from GitHub and I can't seem to figure out why this line of code is there, nor can I find anything about it online.
window.addEventListener("load", function() {
What does "load" do?
The window.onload event is used to kick-start web applications. This could be something trivial like animating a menu or something complex like initializing a mail application.
The onload event fires after all page content has loaded.
https://developer.mozilla.org/en-US/docs/Web/Events/load
also look at the following link
https://developer.mozilla.org/en-US/Add-ons/Code_snippets/On_page_load