Re: Getting IFRAME text
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: Getting IFRAME text

From: Aaron Gray <ang.usenet@gmail.com>
Date: Thu Nov 10 2005 - 21:57:17 CET

> <input type="button" value="Copy"
> onclick="DoCopy(this.form.elements.textarea, 'iframe')">
>
> function DoCopy (textControl, iframeName) {
> if (window.frames && window.frames[iframeName] &&
> window.frames[iframeName].document &&
> window.frames[iframeName].document.body &&
> window.frames[iframeName].document.body.innerHTML)
> {
> textControl.value =
> window.frames[iframeName].document.body.innerHTML;
> }
> }
>

Great, the text appears as a <pre> block, but using InnerText rather than
innerHTML sorts that out and just copies the raw text :)

Thanks alot,

Aaron
Received on Mon Nov 21 03:24:49 2005