Availability: |
| ||||||
Inherits from: | Element object | ||||||
JavaScript syntax: | IE | myIFRAME = myDocument.all.anElementID | |||||
IE | myIFRAME = myDocument.all.tags("IFRAME")[anIndex] | ||||||
IE | myIFRAME = myDocument.all[aName] | ||||||
- | myIFRAME = myDocument.aName | ||||||
- | myIFRAME = myDocument.getElementById(anElementID) | ||||||
- | myIFRAME = myDocument.getElementsByName(aName)[anIndex] | ||||||
- | myIFRAME = myDocument.getElementsByTagName("IFRAME")[anIndex] | ||||||
HTML syntax: | <IFRAME> ... </IFRAME> | ||||||
Argument list: | anIndex | A reference to an element in a collection | |||||
aName | An associative array reference | ||||||
anElementID | The ID value of an Element object | ||||||
Object properties: | align, dataFld, dataSrc, frameBorder, frameSpacing, height, hspace, longDesc, marginHeight, marginWidth, name, noResize, scrolling, src, tabIndex, vspace, width | ||||||
Event handlers: | onClick, onDblClick, onHelp, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp |
An <IFRAME> is a special MSIE supported tag that introduces an inline frame into a document that appears like a block structured element within the document text flow, accessible as a named frame object that belongs to the document.
Its properties appear to be all read-only in the MSIE browser. Changing them seems to have no visible effect at all. The properties belonging to the object retain the values that you assign and return them when requested but the display does not change.
The DOM level 1 specification refers to IFRAME objects as IFrameElement objects and this makes them available in Netscape by virtue of its support for DOM level 1.
DOM level 2 adds the contentDocument properties.
Netscape does not support the <IFRAME> tag prior to version 6.0, but it does support an <ILAYER> tag, which describes an inline layer which is not the same thing but may provide a way to emulate the <IFRAME> functionality in some cases.
MSIE seems to have trouble locating an IFRAME object in the document hierarchy, and you cannot refer to the object directly in the same way that you can with other objects.
With an IFRAME object whose ID is "MYFRAME" this accessor works:
document.all.MYFRAME
But these accessors don't:
document.MYFRAME
MYFRAME
Even worse, the IFRAME appears to float in some separate plane to its containing object. Placing an <IFRAME> inside a <DIV> block exhibits some very strange behavior. Its position seems locked to the top left of the <DIV> but its right edge seems to be able to flow outside the <DIV> area.
Netscape 6.0, which implements IFRAME objects, does not appear to fare any better, exhibiting similarly strange behavior.
See also: | Element object, Frame object, Window object |
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
align | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
dataFld | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
dataSrc | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
frameBorder | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
frameSpacing | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
height | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
hspace | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
longDesc | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
marginHeight | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
marginWidth | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
name | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
noResize | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
scrolling | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
src | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
tabIndex | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
vspace | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
width | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
Event name | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
onClick | 1.5![]() | 1.0 ![]() | 2.0 ![]() | 3.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onDblClick | 1.5![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onHelp | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onKeyDown | 1.5 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onKeyPress | 1.5 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onKeyUp | 1.5 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseDown | 1.5 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseMove | 1.5 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseOut | 1.5![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseOver | 1.5 ![]() | 1.0 ![]() | 2.0 ![]() | 3.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseUp | 1.5![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
Prev | Home | Next |
if( ... ) ... else ... | Up | IFRAME.align |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |