How to update other frame when new document loaded into a frame

Discussion in 'Javascript' started by Jim Cobban, Jul 31, 2005.

  1. Jim Cobban

    Jim Cobban Guest

    My base frameset looks like:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">
    <HTML>
    <HEAD>
    <TITLE>Physical Layer</TITLE>
    </HEAD>
    <FRAMESET cols="20%, 80%">
    <FRAME src="PhysicalLayerTOC.html" name="toc"/>
    <FRAMESET rows="45%, 22%, 33%">
    <FRAME src="Title.html" name="foil" frameborder="no"/>
    <FRAME src="NavBar.html" name="navbar" frameborder="no"/>
    <FRAME src="TitleNotes.html" name="notes" frameborder="no"/>
    </FRAMESET>
    <NOFRAMES>
    <P>This frameset document contains:
    <UL>
    <LI><A href="Title.html">Title Page for Physical Layer Section</A>
    <LI><A href="TitleNotes.html">
    Notes for Title Page for Physical Layer Section</A>
    </UL>
    </NOFRAMES>
    </FRAMESET>
    </HTML>


    PhysicalLayerTOC.html contains links to load the various subdocuments into
    the frame names "foil":

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">
    <HTML>
    <HEAD>
    <TITLE>Table of Contents</TITLE>
    </HEAD>
    <BODY>
    <H1>Index</H1>
    <p><b><a href="Title.html" target="foil">Physical Layer</a></b></p>
    <p><b><a href="Foil2.html" target="foil">Transmission</a></b></p>
    <p><b><a href="Foil4.html" target="foil">Media</a></b></p>
    <p><b><a href="Foil6.html" target="foil">Terminology</a></b></p>
    <p><b><a href="Foil7.html" target="foil">Telcoese</a></b></p>
    <p><b><a href="Foil8.html" target="foil">Topologies</a></b></p>
    <p><b><a href="Foil9.html" target="foil">Adaptation</a></b></p>
    <p><b><a href="Foil10.html" target="foil">Direct Signalling</a></b></p>
    <p><b><a href="Foil11.html" target="foil">Line Driver</a></b></p>
    </BODY>
    </HTML>

    I have a couple of issues I am trying to resolve:

    1) Whenever a new document is loaded into frame "foil" I want to load a
    corresponding notes document into the frame "notes"
    2) Whenever a new document is loaded into frame "foil" I want to update the
    previous and next document hrefs in the document NavBar.html

    I have tried a number of things, both based upon the O'Reilly book and upon
    threads in this and other groups and I just can't seem to get it working. I
    am using IE6 on Win XP Home.

    For example I have tried the following (from "Foil2.html"):

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <script>
    update()
    {
    top.notes.location="Foil2Notes.html";
    top.navbar.document.prev.href="Title.html";
    top.navbar.document.next.href="Foil3.html";
    }
    </script>
    </HEAD>
    <BODY LANG="en-US" DIR="LTR" onload="update()">
    ....

    IE6 detects that the Script is present because the first time I opened
    "Foil2.html" it asked for permission to run the code. However the contents
    of the "notes" frame do not change, nor do the links in the navbar frame.

    FYI "NavBar.html" looks like:

    <html>
    <head>
    <title>My Presentation</title>
    </head>
    <body>
    <img src="Images/CommLine.jpg" border=0/>
    <br/>
    <center><a href="Title.html" target="foil" name="first">
    <img src="Images/top.jpg" alt="First slide" border=0></a>
    &nbsp;
    <a href="Title.html" target="foil" name="prev">
    <img src="Images/prev.jpg" alt="Previous slide" border=0></a>
    &nbsp;
    <a href="Foil2.html" target="foil" name="next">
    <img src="Images/next.jpg" alt="Next slide" border=0></a>
    &nbsp;
    <a href="Foil11.html" target="foil" name="last">
    <img src="Images/bot.jpg" alt="Last slide" border=0></a>
    &nbsp;
    <a href="../layers.html" target="_top" name="home">
    <img src="Images/home.jpg" alt="Home page" border=0></a>
    </center>
    <hr/>
    </body>
    </html>
     
    Jim Cobban, Jul 31, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcelo Birnbach [MS]
    Replies:
    0
    Views:
    3,329
    Marcelo Birnbach [MS]
    Jun 28, 2003
  2. Udo Corban
    Replies:
    0
    Views:
    3,852
    Udo Corban
    Jan 23, 2004
  3. Bruce

    Document Write to other frame

    Bruce, Jul 3, 2004, in forum: Javascript
    Replies:
    2
    Views:
    112
    Bruce
    Jul 8, 2004
  4. Adam Ratcliffe

    Set document loaded by XHR into Frame

    Adam Ratcliffe, Apr 16, 2005, in forum: Javascript
    Replies:
    0
    Views:
    90
    Adam Ratcliffe
    Apr 16, 2005
  5. Replies:
    2
    Views:
    190
Loading...

Share This Page