470,561 Members | 1,909 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,561 developers. It's quick & easy.

Reading data from table cell or IFRAME


Folks,

I have a cell in a table that has an IFRAME - The IFRAME is empty (ie it
has no source tag) but it does have a name (myFrame) and id (also called
myFrame).

I can write data to the frame, but cannot append to it - I know I could
put a textarea form box in there, however that is my least prefered
route in part because I have such little control over the display of the
contents that appears inside a <textarea> are box.

Thus... if I write data to using:

document.getElementById('myFrame').innerHTML="<fon t size=+1
color=yellow>&pound;"+tmp0+"</font>";

How can I append to the data already existing in the box - I gather I
would have to first read the contents, then append my new data, then
re-write to it but I'm not so sure on how I could do this...

All help, via the newsgroup would be much appreciated,
thanks in advance,
randell d.
Jul 20 '05 #1
1 2182
Reply Via Newsgroup wrote:

Folks,

I have a cell in a table that has an IFRAME - The IFRAME is empty (ie it
has no source tag) but it does have a name (myFrame) and id (also called
myFrame).

I can write data to the frame, but cannot append to it - I know I could
put a textarea form box in there, however that is my least prefered
route in part because I have such little control over the display of the
contents that appears inside a <textarea> are box.

Thus... if I write data to using:

document.getElementById('myFrame').innerHTML="<fon t size=+1
color=yellow>&pound;"+tmp0+"</font>";

How can I append to the data already existing in the box - I gather I
would have to first read the contents, then append my new data, then
re-write to it but I'm not so sure on how I could do this...

All help, via the newsgroup would be much appreciated,
thanks in advance,


myVar = document.getElementById('myDiv').innerHTML;
document.getElementById('myDiv').innerHTML = myVar + newHTML;

or simply set it at one time:

document.getElementById('myDiv').innerHTML =
document.getElementById('myDiv').innerHTML + newHTML;

or simpler:

document.getElementById('myDiv').innerHTML += newHTML;

Used with a div tag though. Not sure why you are using an IFrame tag
when it doesn't actually work that way. You have to document.write to an
IFrame, not change its innerHTML property.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bootstrap bill | last post: by
8 posts views Thread by Rose Chambers | last post: by
1 post views Thread by cotton_gear | last post: by
1 post views Thread by Jeronimo Bertran | last post: by
5 posts views Thread by prasanta | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.