HTML Hot Tip: Loading Multiple Frames With One Link

People creating documents using frames eventually hit a common problem: how to load documents into two frames when the user clicks just one link. Normally, the target of an <a> tag is just one window or frame, but with a bit of trickery you can load two or more frames at one time, provided they are arranged a certain way in the browser window.

Consider this frame layout:

Browser window
Frame A Frame B
Frame C Frame D

If someone clicks a link in frame A, the only you can do is update one of the four frames. Suppose you wanted to update frames B and D at the same time?

The trick is to replace frames B and D with a single frame, like this:

Browser window
Frame A Frame BD
Frame C

Ahah! Now you have a single target in which to load a single document, frame BD. The document you load should contain the original frames B and D in one column, which will fill frame BD and give the appearance of two frames being updated at one time.

The drawback to this is that the frames must be adjacent and able to be grouped into a single document. For most pages, though, this solution works fairly well.

Of course, if you are willing to delve into JavaScript or Java, you can implement any sort of frame updating you desire.