Skip to main content
\n","learningResourceType":"Practice problem","educationalLevel":"hard","about":"HTML","teaches":"the preload scanner","url":"https://journeyuncommon.com/quiz/question/46c7c95a-028f-4f5f-ae7d-4d69417c2c23","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
hardHTMLthe preload scannerSingle-choice MCQ

A page sets a resource hint and later writes markup that injects content via document.write. Given the snippet, why does the URL inside document.write generally NOT get discovered by the preload scanner, while the <img> below it does?

<script> document.write('<img src="/hero-from-write.jpg">'); </script> <img src="/hero-static.jpg">