Caffeinated Coder
Book an appointment
Lesson 15 · How browsers use HTML

Iframes and embeds

An iframe puts a whole second web page inside yours. Follow one five-line page from cafe.example as the browser reads it: the parser makes an empty box, the box sends its own request to map.example, and a second document with its own DOM fills it. Then see the walls between the two pages: contentDocument comes back null, postMessage gets through, sandbox takes powers away, and a site can refuse to be framed at all.

12 min10 steps5 questionsAdvanced
Fig 15 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.