| View previous topic :: View next topic |
| Author |
Message |
barrydrez
Joined: 10 May 2006 Posts: 2
|
Posted: Wed May 10, 2006 6:56 pm Post subject: Getting IFrame contents |
|
|
Hi - I have an IFrame within an html document that is linked to an external html file. The frame correctly renders the html from the external file. What I would like to do next is retrieve the contents of the IFrame and display it (for the time being in an alert dialog). For some reason, all I can display is the html for the parent page. I'll be happy with just the rendered output if that is possible. I am using IE6. Here is the code:
| Code: |
<html>
<script type="text/javascript">
function showcontents() {
alert(document.getElementById('dummyIFRAME').document.body.innerHTML);
}
</script>
<BODY TEXT="#000000" BGCOLOR="#FFD700" LINK="#FFFF00" ALINK="#33FFCC" VLINK="#FF3333">
<br>
<input onclick='javascript: showcontents()' type='button'
value='show'></input><br><br><br><br><br><br><br><br>
<iframe id='dummyIFRAME' name='dummyIFRAME' src="http://online.kitco.com/scripts/cgi-bin/texten.pl"></iframe>
</body>
</html>
|
Thanks for any help - Barry |
|
| Back to top |
|
 |
|
|
DrAmbar
Joined: 04 Sep 2006 Posts: 2
|
Posted: Mon Sep 04, 2006 11:08 am Post subject: Re: Getting IFrame contents |
|
|
Hi Barry,
Yes, innerHTML would get the original text in the document and naturally not the contents of the url it references.
In my opinion, what you are attempting (grabbing the content of another webpage into the javascript of this page) may not be possible.
Ambar |
|
| Back to top |
|
 |
barrydrez
Joined: 10 May 2006 Posts: 2
|
Posted: Tue Sep 05, 2006 12:46 pm Post subject: Re: Getting IFrame contents |
|
|
| Thanks, Ambar. |
|
| Back to top |
|
 |
|