...

View Full Version : refering to a frame with nested frames



CmTs
12-09-2004, 03:42 PM
Hi There;
I've created a web page with three frames. A heading frame, a table of contents frame and a main frame.

_______________
| Heading Frame |
|_______________|
|LHS | MAIN |
|_____|_________|

In the contents frame i want to print when the web page was last updated. I couldn't do this so i tried using frontpage to make up a similar (but less complex) example where i try to print to screen the page title of the Main frame. However i can't seem to refer to the Main frame. Or rather, the page title is blank. In the simpler version the heading frame is new_page_2, the content frame(where i try to refer to the main frame) is new_page_4, and the main frame is new_page_3. Any help would be greatly appreciated. Thanks in advance.

***** OUTPUT IN new_page_4 **************
12/09/2004 header New Page 2 ,
LHS New Page 4 , RHS THE END
**************************************

<html>
<head>
<title>New Page 1</title>
</head>

<frameset rows="124,*">
<frame name="banner" scrolling="no" noresize target="contents" src="new_page_2.htm">

<frameset cols="263,*">
<frame name="contents" target="main" src="new_page_4.htm">
<frame name="main" src="new_page_3.htm">
</frameset>

<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
********************************************
*********************new_page_1.htm*****************
<html>
<head>
<title>New Page 2</title>
<base target="contents">
</head>

<body>
</body>
</html>
**************************************************

*******************new_page_4.htm*******************
<html>
<head>
<title>New Page 4</title>
<base target="main">
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
document.writeln(document.fileModifiedDate)
document.writeln("header " + top.frames[0].document.title + " , ")
document.writeln("LHS " + top.frames[1].document.title + " , ")
document.writeln("RHS " + top.frames[2].document.title + " THE END ");
</SCRIPT>
</body>
</html>
************************************************
*******************new_page_3.htm*****************
<html>
<head>
<title>New Page 3</title>
</head>

<body>
</body>
</html>
**************************************************

aifilaw
12-09-2004, 10:34 PM
try:

top.document.frames[0].document.title

CmTs
12-09-2004, 10:56 PM
Thanks for the idea but i have tried that. It gets me the "Heading" frame. I think it's top.frames[2] that i want. Or at least that's the one that is printing blank right now. Any more ideas?

CmTs
12-12-2004, 06:47 PM
Hi All;
I'm still trying to figure out what i'm doing wrong when i try to access the information of the Main frame. Could it be that the LHS or Contents frame is mentioned(created) first in the frameset and so doesn't know the Name of the Main frame? Any suggestions would be really appreciated...(*crickets*)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum