Is iframe equivalent to window?

I'm trying to understand a hierarchical picture of window, document and iframe.

So, window is simply the browser's window and document is where the DOM exists. The document is loaded in window.

Is creating an iframe much like creating a dialog (window.openDialog()) (which is nothing but a window)?

Both have a content document and parent window.

Answers:

Answer

Here's a very good discussion from WHATWG, the founders of HTML5: 6 Loading Web pages -- HTML: The Living Standard - Edition for Web Developers

In summary, but lots more at the actual page:

A browsing context is an environment in which Document objects are presented to the user.

A tab or window in a Web browser typically contains a browsing context, as does an iframe.

and

Certain elements (for example, iframe elements) can instantiate further browsing contexts. These are called nested browsing contexts.


And, if you want to know more about WHATWG: FAQ - WHATWG Wiki

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.