Updating two frames at a time

JavaScript FAQ | JavaScript Frames FAQ  

Question: Can I update two (or more) frames simultaneously?

Answer: Yes. The easiest way to update several frames simultaneously is to have a JavaScript function that loads a new page into each of the frames to be updated.

For example, suppose you have two frames, left and right, defined in a FRAMESET like this:

<FRAMESET cols="200,*" border=3 frameborder=yes framespacing=2 >
  <FRAME SRC="leftpage.htm" NAME="left">
  <FRAME SRC="rightpage.htm" NAME="right">
Then a function for updating both frames might look like this:
function updateBothFrames() {
This function can be called when the user presses a button or clicks a hyperlink.
The following examples show the HTML code for a button and hyperlink that invoke the function:
<a href=#
   onclick="updateBothFrames();return false;"
>Click here</a>

<input type=button 
       value="Press me" 

Copyright © 1999-2011, JavaScripter.net.