0 points

Call something when the entire page has loaded


dashboard

Fri Nov 20 2020 06:06:10 GMT+0000 (UTC)

Posted by @eneki

window.addEventListener('load', (event) => {
    console.log('The page has fully loaded');
});
content_copy Copy

For the window object, the load event is fired when the whole webpage (HTML) has loaded fully, including all dependent resources such as JavaScript files, CSS files, and images. To handle the load event, you register an event listener using the addEventListener() method:

https://www.javascripttutorial.net/javascript-dom/javascript-onload/