Page 1 of 1

Framesets and <TITLE>

Posted: Wed Mar 12, 2003 9:01 am
by Zomis
When you use a frameset, and you want browsers to display the title of one of the frames, how to do?

index.php:

Code: Select all

<HEAD>
<TITLE>Zomis Productions</TITLE>
</HEAD>
<HTML>
  <FRAMESET rows="80, *, 50" border="0">
    <FRAME src="frame_top.php" noresize scrolling="no">
    <FRAME src="home.php" noresize scrolling="yes" name="mainFrame">
    <FRAME src="frame_bottom.html" noresize scrolling="no">
  </FRAMESET>
</HTML>
home.php:

Code: Select all

<HEAD>
<TITLE>Zomis Productions - Home</TITLE>
</HEAD>
This is Zomis Productions' home page!<BR>
Now, when I go to index.php it says "Zomis Productions" in the title, not "Zomis Productions - Home"!
If I remove the title in the index.php the title is the address instead,
so how should I do to display "Zomis Productions - Home" in the title (or whatever the title of the frame "mainFrame" is).

hope you understand me...

Posted: Wed Mar 12, 2003 7:07 pm
by phice
First, try to remove the <TITLE>...</TITLE> inside index.php. That may work, if not, just change the value inside the <TITLE> tags in index.php.

Posted: Thu Mar 13, 2003 3:37 am
by Zomis
phice wrote:First, try to remove the <TITLE>...</TITLE> inside index.php. That may work, if not, just change the value inside the <TITLE> tags in index.php.
If I remove the tags in index.php, the adress shows up as the title instead (i.e. "http://zomis.xplorer.nu").
And If I change the value inside the tags, I will only have one constant value, but I want the title of the frame as the title.
And the title of the frame changes, depending on which page I am at.

Posted: Thu Mar 13, 2003 6:31 am
by patrikG
If called from the frame-parent

Code: Select all

<script language="JavaScript" type="text/javascript">
document.title=document.mainFrame.document.title;
</script>
If called from within a frame

Code: Select all

<script language="JavaScript" type="text/javascript">
parent.document.title=document.title;
</script>

Posted: Sat Mar 15, 2003 3:08 am
by m3mn0n
Very nice, i've never known how to do that before. 8)