Pure Javascript equivalent to jQuery $(window).load()

The pure Javascript equivalent to

window_load_equivalent.js
$(window).load(function() {
    // Your code goes here!

})

is

example.js
window.addEventListener("load", function() { 
    // Your code goes here!
});

Note that it’s not supported by IE8, but that should not be an issue in 2019.


Check out similar posts by category: HTML, Javascript