3 ms·
There are a few events that get fired during a page load. DOMCotentLoaded is fired when the page and all its assets are loaded, so that's usually considered the
by onion2k 10y ago
There are a few events that get fired during a page load. DOMCotentLoaded is fired when the page and all its assets are loaded, so that's usually considered the point at which it's finished loading. With modern JS based pages that sometimes isn't enough though, so new browsers have documentRequestIdleCallback which fires a callback when the browser isn't busy, which is quite useful.
- jayflux 10y agoAre you not confusing DOMContentLoaded with window.load? DCL doesn't wait for assets last time I checked, it only waits until the page is parsed and a tree has been created. .load waits for assets https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded https://developer.mozilla.org/en-US/docs/Web/Events/DOMConte...