|
October 6, 2000 Replacing a Frame's Content Tips: October 2000
Yehuda Shiran, Ph.D.
|
|
In Internet Explorer 5.5 and up, you can retrieve the FRAME or IFRAME object that is hosting the current window. You find it by window.frameElement. Once you have the frame object, you can do a lot of stuff. For example, you can load a new document into the frame. The following script does just that:
Let's take an example. The following three documents represent a frameset of two frames. You can switch the content of the left frame by clicking the Switch button. Here is the frameset:
Here is the left frame:
And finally, the right frame:
Go ahead and play with it. Learn more about frames in Column 36, JavaScript and Frames, Part I, and Column 37, JavaScript and Frames, part II.
People who read this tip also read these tips: Look for similar tips by subject: |