Forum Moderators: open

Message Too Old, No Replies

Gecko - Put titles of pages in frame as frame's title?

Gecko bug url included for easy clarification!

         

JAB Creations

7:15 pm on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is a bug in Gecko where the pages navigated in a site with frames do not appear in the back/forward buttons. Instead Gecko midlessly just dumps the frame's title which is completely retarded. Here is the bug I posted on Bugzilla that includes IE and Gecko screenshots...

[bugzilla.mozilla.org...]

I'm sure there is a way and this will help me learn the dom a little more hopefully!

I want to detect gecko so to do that I start off with...

if navigator.userAgent.indexOf("Gecko")!=-1){

and then here is where I personally reach the end of the continental shelf...

I need to say take the title from the framed page (page that is inside the frame) and replace the frame's title with the framed page's title.

What I'm hoping is that this will allow Gecko users (until they fix an OBVIOUS bug that YES is indeed a bug regardless of how much people hate frames) to see the titles of the pages they have navigated and not have to play a guessing game at which one of the same twenty thousand pages is the one they want when navigating my site!

Let the fun begin! :)

garann

9:26 pm on Sep 29, 2005 (gmt 0)

10+ Year Member



Ooo, that is a fun one. I found I needed to do it in two parts, cause I couldn't find a way to get a reference to the
document
in the frame.

The child used this to call a function in the parent:

window.parent.setTitle(document.title);

(Note that call needs to come after the title element.)

The parent supplies this function:

function setTitle(newTitle) {
document.title = newTitle;
}

It worked in Firefox, so I'm assuming it will work for all Gecko browsers?

Bernard Marx

9:53 pm on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think you need a function in the parent there.
This works - in that it change's the main title to that of the frame that executes the statement:

parent.document.title = document.title;

It doesn't appear to have any effect on the titles in the back button history though.

kaled

10:09 pm on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When I tried assigning the document.title ages ago, I found some browsers (I can't remember which) refused, with an error message along the lines of "cannot write to a read-only property".

Kaled.

Bernard Marx

10:35 pm on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Those browsers must be a bit thin on the ground these days, surely?
(Stupid, animated title scripts have been plaguing the Web for donkeys)

JAB Creations

2:59 pm on Oct 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't suppose serverside scripting would help any since the frame page would have to be sent EVERYtime a link is clicked! The whole point is to display the framed page's title in the back/forward button's drop down menus.