PDA

View Full Version : iframe



sandyd
May 27th, 2009, 01:33 AM
how do i make the page read the title of the page thats in the iframe and display it as the page title?

as in...

if the page being displayed by the iframe is "dog", i want the parent page that the iframe to have the title "dog"

Reiger
May 27th, 2009, 01:43 AM
Rephrased: I want to transfer text content from the iframe element xyz to the title element; how do I modify the underlying document? Answer: look into modifying the DOM Tree of the underlying document with for instance a bit of JavaScript.

DocForbin
May 27th, 2009, 02:03 AM
Untested, but in the iframe onload you should be able to use parent.document.title = document.title (assuming they are on the same domain). Or from the parent you could use document.title = frames['myframe'].document.title.

hth