Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q853 How can you dynamically write content to a floating frame (IFRAME)?

irt.org | Knowledge Base | JavaScript | Frame | Q853 [ previous next ]

Q853 How can you dynamically write content to a floating frame (IFRAME)?

Try the following which works in Internet Explorer 4+ and Netscape Navigator 6+:

<iframe width="100%" height="100" src="blank.htm"></iframe>

<script language="JavaScript"><!--
document.frames[0].document.open();
document.frames[0].document.write('Hello world');
document.frames[0].document.close();
//--></script>

The following was submitted by Stefano B.

This works only on onload() method or onclick() method:

<!--Writing html//-->
idContent.document.body.innerHTML="<b>test</b>";
<!--Writing text//-->
idContent.document.body.innerText="<b>test</b>";

Feedback on 'Q853 How can you dynamically write content to a floating frame (IFRAME)?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.