Reply to Re: get contents of iframe

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация