Window.frames[] (Collection)

An array containing window objects, each one referring to the content of a frame within the window.


JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Opera - 3.0
Property/method value type:Frames object
JavaScript syntax:-frames

The frames property yields an array containing objects, each one of which refers to a separate frame. You can count how many there are with the window.frames.length property. In MSIE, this also includes any inline floating frames created with an <IFRAME> tag.

You can cross-reference between frames in a window by means of the frames property. Every window refers to a frames array, which contains a list of frames within that window. Each frame contains a different window. This can get confusing, but it simply means that frames correspond to windows at the basic object level.

You can also use the opener, parent and top properties as well when you are cross-referencing between windows and frames.

Frames arrays may be nested where windows contain frames within frames. The frames array is like all others, its first element is at index 0. This means that something as confusing as this is legal:


As a window reference, that looks in the current window for the first frame, then into the third frame within that and then the second frame within that.

You can use the parent window reference to access windows that are all at the same hierarchical level as the current one. This would be accomplished like this:

parent.frames[ ... ]


See also:<MAP TARGET="...">, Document object, Document.frames[], Frame object, Frames object, Window object, Window.opener, Window.parent,

Property attributes:


insert figure 0060


Wrox Instant JavaScript - page - 80