View Full Version : dynamic title for frameset page

07-05-2002, 04:19 PM
This should be an easy one, but I can't come up with the answer. I have a page coded in HTML like so:

<TITLE>My Database</TITLE>
self._domino_name = "_Welcome";
// -->
<FRAMESET ROWS="4*,96*">

<FRAME NORESIZE NAME="top" SRC="http://www.mydomain.com/mydb.nsf/TopPage?OpenPage" SCROLLING=no>

<FRAME NORESIZE NAME="bottom" SRC="http://www.mydomain.com/mydb.nsf/Page1?OpenPage" >

The "TopPage" is a custom navigator function I've built in JavaScript, and when I click on a link to "Page2" in the top frame, "Page2" loads in the bottom frame. This works with no problems. However, what I want to do is dynamically generate a title for "FramePage" depending on what is loaded in the bottom frame. For example, when a user first loads this page, the title on the browser would read "My Database - Page1". When the user links to Page2, the title changes to "My Database - Page2".

I've tried doing this using the native development tool (Lotus Domino), but so far haven't been succesful. How would I go about writing a JS function for this? Any advice is appreciated.


07-05-2002, 10:18 PM
after the body tag

doesn't work on NS4 (four) though.


06-29-2005, 02:20 PM
I have a similar problem to the one stated above, but I've tried the code given and I can't get it to work.

I am using a simple frameset two frames "contents" on the left for the navigation and "main" for the rest of the page.

I want to dynamically change the <title> in the frameset page to that of the page that is currently in the "main" frame.

I know very little about javascript so as well as the code I need to know where it goes, and in which document. e.g. "after the body tag" implies that it is in the framed page because there is no body tag within the frameset. It also doesn't tell me if it should be after the opening or closing body tag. (I tried all possible combinations with no success.)

06-29-2005, 03:34 PM
That code has to go in every page.

If you want it in the frameset instead of every page use this. Put it anywhere in the head or body of the frameset.
Change 'framename' as appropriate to the name of the frame that contains the title you want to display.

<script type="text/javascript">
function changeTitle()
if (top.frames['framename'].document.title)

Now, that assumes only one level of frames. If you're nesting, you need to change this structure:
as appropriate.

Now that you have that function, it needs to get called every time the document changes. So, add an onload handler to the frame that contains the doc you want the title of.

NAME="bottom" SRC="http://www.mydomain.com/mydb.nsf/Page1?OpenPage"

Try that. I don't have a 'set to putz with right now, so this is theoretical. :D

06-29-2005, 06:53 PM
Thank you NikkiH, That works a treat.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum