470,619 Members | 2,065 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

What am I doing wrong in updating other frames

I have a set of web pages that are organized in pairs. One of each pair
contains a graphic and the other is an extended description of the graphic.
I am trying to set it up that selecting a single hyperlink causes the
correct pair of web pages to be loaded into two windows. My current
approach is to specify an onload action in the <BODY> tag of one of the
pages that requests that the corresponding description page be loaded into
the other frame, as well as updating associated forward and backward link
buttons. But I cannot get it to work.

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>

Aug 7 '05 #1
3 1643
Hi Jim,

Jim Cobban schrieb:
top.notes.location="Foil2Notes.html";


location is an object, the URL can be set with
top.notes.location.href = "Foil2Notes.html";

Greetings,

Martin
Aug 7 '05 #2
ASM
Jim Cobban wrote:
I have a set of web pages that are organized in pairs. One of each pair
contains a graphic and the other is an extended description of the graphic.
I am trying to set it up that selecting a single hyperlink causes the
correct pair of web pages to be loaded into two windows.
<a href="graphic_1.gif" target="frame_1"
onclick="parent.frame_2.location='text_1.htm';">gr af 1</a>

or
<a href="text_1.html" target="frame_2">graf 1</a>
and 'text_1.html' has :
<body onload="parent.frame_1.location='graphic_1.gif';">

As you can see (and regardless to your codes given)

it is not :
top.frame.location
but :
parent.frame.location
as you have only an alone frameset
(no other frameset file opened in one of your frames)
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"
page opened in 'foil'
<body onload="parent.notes.location='Notes10.htm';">
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
page opened in 'foil'
<body
onload="parent.notes.location='Notes10.htm';
with(parent.navbar.document)
{
links['prev'].href='Foil09.htm';
links['next'].href='Foil11.htm';
}">
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.
kind of browser has any importance to load pages in frames
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>
please :
<script type="text/javascript">
or other type if script is other than JS
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()">
does really O'Reilly give this kind of code ?

at least, and if function update() is known, I would expect :
update()
{
top.notes.location="Notes2.html";
// and not unknown file ('Foil2Notes.html')
top.navbar.document.getElementById('prev').href="T itle.html";
// if 'prev' is the ID of this link
// and not a personal IE code :
// top.navbar.document.prev.href="Title.html";
top.navbar.document.links['next'].href="Foil3.html";
// if 'next' is the name of this link
}
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>


Please do something as following (for other browsers than IE) :

<a href="Title.html" target="foil" name="prev">
<img src="Images/prev.jpg" alt="Button previous slide"
title="Previous slide" border=0></a>
--
Stephane Moriaux et son [moins] vieux Mac
Aug 7 '05 #3

"Martin Kurz" <in**@martinkurz.in-berlin.de> wrote in message
news:11*************@elch.in-berlin.de...
Hi Jim,

Jim Cobban schrieb:
top.notes.location="Foil2Notes.html";


location is an object, the URL can be set with
top.notes.location.href = "Foil2Notes.html";

Thank you for that pointer. I have tried both top.notes.location.href and
parent.notes.location.href and neither causes any change to the page
displayed in the other frame.
Aug 8 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

121 posts views Thread by typingcat | last post: by
8 posts views Thread by UJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.