More Frame Hierarchies

This frame, has the frame name "links_frame" and contains the file "leftframe.htm". The frame below has the frame name "bottom_target" and contains the file "bottomframe.htm". The frame to the right has the frame name "right_target" and contains the file "rightframe.htm". It is important to distinguish between a frame's name and it's content.

This contents of this frame (leftframe.htm) contains the JavaScript used to write to the other frames. We are referring to frames using the parent and top properties of the window object and using document.writeln() to write to them. We can call other object methods on those frames as well, for instance the last link we use the location object to change the location URL of the frame.

Write to right frame using: top.right_target.document.writeln()

Writeto right frame using: parent.right_target.document.writeln()

Write to bottom frame using: top.bottom_target.document.writeln()

Change bottom frame file content: parent.bottom_target.location='leftframe.htm';

View Source to see JavaScript.

Back to examples