|
Posted by Neredbojias on 04/21/06 11:23
To further the education of mankind, "markww" <markww@gmail.com>
vouchsafed:
> I cannot get the contents of an iframe in my page, it is quickly
> driving me insane. My iframe is defined like:
>
> <iframe id = "e_body" name = "e_body" src="about:blank"></iframe>
>
> I've made a function to retrieve the contents like:
>
> function GetIFrameContentsPlease()
> {
> var strContents =
> document.getElementById("e_body").document.body.innerHTML;
>
> alert("the contents are: " + strContents);
> }
>
> but it fails. I need this to work on IE and FF, any suggestions?
You realize you do need an actual source (-html document) in order to get
the contents of the iframe? I don't know if "about:blank" does it.
With that in mind, try this:
setTimeout("alert(e_body.document.body.innerHTML);",10);
--
Neredbojias
Infinity has its limits.
Navigation:
[Reply to this message]
|