Introduction
Account Policies
Problem Solving
Instructor Help
General help by subject
Hypertext and the web
Remote access
Contact NWE Help
Main help page
NWE Help: Web: Authoring: HTML: Tips: Frames
NWE Home :: Help :: Web :: Authoring :: HTML :: Tips
If you are working with frames and you want two windows to change at once, here's a simple script that allows that. (For more information about frames, see our frames help.)
Copy the following code and place it after the <Title> tag:
The part that states parent.left.location.href=doc1+".html"; means that you have a frame whose name is "left." Same thing exists for the middle indication. If your frames have different names, simply change these to whatever names you have already indicated.
<script language="JavaScript"> <!-- Hide var jsOK = false; // --> </script> <script language="JavaScript1.1"> <!-- Hide jsOK = true; // --> </script> <script language="JavaScript"> <!-- Hide function change_frames(doc1,doc2) { parent.left.location.href=doc1+".html"; parent.middle.location.href=doc2+".html"; } // --> </script>
Next, place the following script where the link that switches the frames is:
Replace page1 and page2 with the names of the pages that will open in the frame locations. Notice that you don't write page.html. The script already allows for the .html extension.
<a href="javascript:change_frames('page1','page2')">text</a>
