The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Possible to do this with JS???

I was wondering if it is possible to do this.

I want to create a frameset where the title of the frameset changes according to the title of the 'content frame'.

ie get the frameset title to = the title of the 'content frame'. Can I swing it around somehow so that the script is just in the frameset? - That way I just have one instance if the script (in the frameset that doesn't change).

As an educated guess from someone totally uneducated in Javascript, I would have thought that inserting this within the frameset may be along the right lines:

Thanks for the help, but I'm afraid it doesn't solve my problem - Although I think its close.

I'll explain why: I'm using anaconda foundation products to make a search engine. If you click on any of the search results you can get them to open in your frameset, with a top frame contaning a back to search button (done via CGI). The problem is that if any of the pages are saved it is the title of the frameset that appears in the Fav's not that of the 'content frame'. As I obviously can't put any code in the content frame it needs to be in either the Frameset or the top frame.

I tried this in the frameset but it didn't work:
<script language="Javascript1.2">

if (document.mainFrame){
document.title=mainFrame.document.title;
}

</script>

I presume I need something along the lines of when mainFrame has loaded alter document.title=mainFrame.document.title

I think - correct me if I'm wrong - the browser doesn't allow you to ask for something like document.title on a webpage that is on another server (for privacy reasons). That would make it impossible to do what you want.