Re: Changing the outerHTML of an Iframe
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Changing the outerHTML of an Iframe

From: Daniel Kirsch <Iwillnotread_daniel@gmx.de>
Date: Tue Apr 11 2006 - 11:01:48 CEST

David Virgil Hobbs wrote:
> However using frames['iframeid'].document.body.innerHTML I am only able
> to change, in the contents of the iframe, the code in between and
> including the body tags; I am not able to change the code above the
> body tag such as what is in the head section and what is in the html
> tag.

Instead of using innerHTML you may create a new document and use
document.write()

You may also access the head element by using DOM methods like:
var htmlElm = document.documentElement;
var headElm = htmlElm.getElementsByTagName("head")[0];

But what are you trying to do in the head?
To change the title, you may use
document.title = "foo";

Daniel
Received on Mon May 1 04:54:44 2006