JavaScript: The Definitive Guide
25.168. IFrame: an <iframe> in an HTML document
DOM Level 2 HTML: Node |
Property | Attribute | Description |
|---|---|---|
deprecated String align | align | Alignment with respect to inline content |
String frameBorder | frameborder | Set to "0" for borderless frames |
String height | height | Height of the viewport in pixels or percent |
String longDesc | longdesc | The URL of a frame description |
String marginHeight | marginheight | Top and bottom frame margin, in pixels |
String marginWidth | marginwidth | Left and right frame margin, in pixels |
String name | name | The name of the frame, for DOM Level 0 lookup and form and link targets |
String scrolling | scrolling | Frame scroll policy: "auto", "yes", or "no" |
String width | width | Width of the viewport in pixels or percent |
25.168.2. Description
Except for small differences in their HTML attributes, <iframe> elements behave very much like <frame> elements in client-side JavaScript. <iframe> elements become part of the frames[] array of the containing window. When accessed through that array, they are represented by Window objects, and the properties listed earlier do not apply.
When an <iframe> element is accessed as a document element by ID or tag name, it is represented by an IFrame object, with the properties shown previously. Use src to query or set the URL of the <iframe>, and use contentDocument to access the contents of the iframe. Be aware, however, that the same-origin policy (see Section 13.8.2) may prevent access to the contentDocument.
25.168.3. See Also
Frame, Window; Chapter 14
Категории