By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

how to append text to HTML displayed in iframe

P: n/a
Mel
how can i add text to an html that is displayed in an iframe ?

thanks
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Mel wrote:
how can i add text to an html that is displayed in an iframe ?


You simply need to access the document in the iframe and then use the
normal DOM methods to create and append stuff e.g. with
<iframe name="iframeName" src="whatever.html" ...></iframe>
you could (once the iframe document is loaded) do
var iframeDoc = window.frames.iframeName.document;
var text;
if (iframeDoc.createTextNode && (text =
iframeDoc.createTextNode('Kibology for all.'))) {
iframeDoc.body.appendChild(text);
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.