Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to append text to HTML displayed in iframe

Reply
Thread Tools

how to append text to HTML displayed in iframe

 
 
Mel
Guest
Posts: n/a
 
      03-22-2005
how can i add text to an html that is displayed in an iframe ?

thanks


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      03-22-2005


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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
the address of list.append and list.append.__doc__ HYRY Python 10 09-26-2007 09:41 AM
Japanese Text not displayed on Image Generated by Servlet on winXP, Linux but displayed on Win2000 boney Java 1 12-15-2006 02:24 PM
"Insert" (not append) new text segment to an existing text file sm C++ 2 04-29-2005 03:55 PM
Get form values from iframe (1) to iframe (2) inside a layer in iframe (1) Daedalous Javascript 3 01-16-2004 11:08 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57