M
Michael
Hello,
A FrontPage book I have describes a technique for simultaneously changing
content in two windows of a frames page using javascript. The idea is that
when you click a hyperlink in the top frame, the .htm file in the top frame
changes and so does the .htm file in the bottom frame.
The book I have says to put Javascript in the hyperlink like the following:
javascriptarent.frames.framename1.location='page2.htm';parent.frames.framename2.location='bottompage2.htm'
However, when I do this, the result is that the browser window clears
entirely (no more frames) and the target page for the top frame takes up the
entire browser window. The bottom frame isn't displayed anywhere.
In toying around with it, I tried eliminating the second javascript command
for the bottom window, to see if I could even change just the content in the
top frame with javascript, so I changed it to
javascriptarent.frames.framename1.location='page2.htm'
But in that instance, the same thing occurs: the frames disappear and
page2.htm takes up the entire browser window (the address line shows the
page2.htm address, not the address of the frames page).
I read a similar thread on this forum and the advice was to use the syntax
javascript:window.parent.top.location='page2.htm'
so parent.frames was replaced with window.parent. I tried that and get the
same result as I had previously.
Does anyone know how I can get this to work, so that when I click a link in
the top frame, a new page is rendered in both the top frame and the bottom
frame?
Thank you.
- Michael Gibbons
Frameset HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>CS600 Demonstration Site - Michael Gibbons</title>
</head>
<frameset rows="24%,*">
<frame name="top" src="demo1.htm" target="none">
<frame name="bottom" src="default.asp">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
Top frame html: (the one with the javascript problem)
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Title goes here</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="29%" rowspan="2">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber2">
<tr>
some text
</tr>
some text
</tr>
2 </table>
</td>
<td width="71%" valign="top"><font face="Verdana" size="2">
some text
</td>
</tr>
<tr>
<td width="71%" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber3">
<tr>
<td width="17%"><font face="Verdana" size="1"><a
href="demo1.htm">Previous</a></font></td>
<td width="17%"><font face="Verdana" size="1">
<a
href="javascript:window.parent.top.location='demo3.htm';window.parent.bottom.location='2.asp'">Next</a></font></td>
<td width="116%" valign="bottom"><font face="Verdana" size="1">
<a target="_top" href="cs600.htm">Start Over</a></font></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Bottom frame html:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Title here</title>
</head>
<body>
Some text
</body>
</html>
A FrontPage book I have describes a technique for simultaneously changing
content in two windows of a frames page using javascript. The idea is that
when you click a hyperlink in the top frame, the .htm file in the top frame
changes and so does the .htm file in the bottom frame.
The book I have says to put Javascript in the hyperlink like the following:
javascriptarent.frames.framename1.location='page2.htm';parent.frames.framename2.location='bottompage2.htm'
However, when I do this, the result is that the browser window clears
entirely (no more frames) and the target page for the top frame takes up the
entire browser window. The bottom frame isn't displayed anywhere.
In toying around with it, I tried eliminating the second javascript command
for the bottom window, to see if I could even change just the content in the
top frame with javascript, so I changed it to
javascriptarent.frames.framename1.location='page2.htm'
But in that instance, the same thing occurs: the frames disappear and
page2.htm takes up the entire browser window (the address line shows the
page2.htm address, not the address of the frames page).
I read a similar thread on this forum and the advice was to use the syntax
javascript:window.parent.top.location='page2.htm'
so parent.frames was replaced with window.parent. I tried that and get the
same result as I had previously.
Does anyone know how I can get this to work, so that when I click a link in
the top frame, a new page is rendered in both the top frame and the bottom
frame?
Thank you.
- Michael Gibbons
Frameset HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>CS600 Demonstration Site - Michael Gibbons</title>
</head>
<frameset rows="24%,*">
<frame name="top" src="demo1.htm" target="none">
<frame name="bottom" src="default.asp">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
Top frame html: (the one with the javascript problem)
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Title goes here</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="29%" rowspan="2">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber2">
<tr>
some text
</tr>
some text
</tr>
2 </table>
</td>
<td width="71%" valign="top"><font face="Verdana" size="2">
some text
</td>
</tr>
<tr>
<td width="71%" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber3">
<tr>
<td width="17%"><font face="Verdana" size="1"><a
href="demo1.htm">Previous</a></font></td>
<td width="17%"><font face="Verdana" size="1">
<a
href="javascript:window.parent.top.location='demo3.htm';window.parent.bottom.location='2.asp'">Next</a></font></td>
<td width="116%" valign="bottom"><font face="Verdana" size="1">
<a target="_top" href="cs600.htm">Start Over</a></font></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Bottom frame html:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Title here</title>
</head>
<body>
Some text
</body>
</html>