Clear And Load A Frame

Here is a small one-line script that you can add to your frames that will allow you to do several things. For instance you can use it to clear one frame by clicking on a link or button in another frame. You may also use it to load a page or image etc. in another frame using the same method. Below are some examples.

In the script examples "NAMEOFFRAME" means the frame you are targeting or trying to load something into or trying to clear. In the example below name="rightframe" would be "NAMEOFFRAME".

<frame name="rightframe" src="display.html">

In the frame you want the link to appear you put the following example. Replace "NAMEOFFRAME" with the name of the frame that you want to clear.

Highlight The Source Code Below

To load a page into the same frame use the following source code.

Highlight The Source Code Below

To clear the frame and to load a page into the frame use the following source code.

Highlight The Source Code Below

To clear 2 frames at the same time do the following.

Highlight The Source Code Below

To load files into 2 frames at the same time do the following.

Highlight The Source Code Below



<<< Back



Home Page       This Page Was Last Updated: