Skip to main content
","learningResourceType":"Practice problem","educationalLevel":"hard","about":"HTML","teaches":"async defer parsing internals","url":"https://journeyuncommon.com/quiz/question/262d5f61-7bd8-418d-ab3e-b112b443370d","inLanguage":"en","isAccessibleForFree":true,"provider":{"@id":"https://journeyuncommon.com/#organization"},"isPartOf":{"@type":"WebSite","@id":"https://journeyuncommon.com/#website","name":"Journey Uncommon","url":"https://journeyuncommon.com"}}
Journey Uncommon Logo
JourneyUncommon
hardHTMLasync defer parsing internalsSingle-choice MCQ

A document.write() call inside an inline script during parsing reopens the input stream at the parser's insertion point. Why can the same document.write() behave very differently when called from an async (or deferred) script versus a parser-blocking inline script?

<script>document.write('<p>hi</p>');</script>