You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you add a script and tag it with “defer”, then you unblock the construction of the DOM: the document interactive state does not have to wait for execution of JavaScript. However, note that this same script will be executed before DCL is fired. Further, recall that JavaScript may query CSSOM, which means that the DCL event may be held until the CSSOM is ready, at which point the script will be executed. In short: we’ve unblocked the “document interactive” state, but we’re still potentially blocking DCL.
The DOMContentLoaded event fires after the transition to "interactive" but before the transition to "complete", at the point where all subresources apart from async script elements have loaded.
The text was updated successfully, but these errors were encountered:
article
article Link 《onload-ondomcontentloaded》
may not accurate
reason
if a page containers some "defer" script, then it will cost some time to execute the "defer" script after interactive but before DCL.
Reference
https://calendar.perfplanet.com/2012/deciphering-the-critical-rendering-path/
https://html.spec.whatwg.org/multipage/dom.html#current-document-readiness
The text was updated successfully, but these errors were encountered: