Reading data from table cell or IFRAME

  • Thread starter Reply Via Newsgroup
  • Start date
R

Reply Via Newsgroup

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="<font 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.
 
R

Randy Webb

Reply said:
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="<font 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top