rewrite table cell content

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am making an ajax application. The request/response part works OK.
Unfortunately the cell in a table won't do what I want. I placed an ID
attribute on the cell and use getElementById to find it. I also tried
putting a DIV tag inside the cell, but that doesn't work, either. This is
with IE. I haven't tried NetScape or FireFox. If I change the cell content
with innerText, the text will change on screen. If I change the cell content
with innerHtml, the cell will not change on screen. The cell is set up to be
a work panel, may display different things, and I send whatever HTML I want
to be displayed in the cell. If I use innerText it will display the HTML
code as text. If I use innerHtml, the HTML will not render.

Alternatively I could have several hidden rows with most of the content,
then turn on whichever row based on info from the server, and some of the
info, too. But that would make the page really complex and difficult to
maintain. I want to send and replace all the HTML in the panel. If anyone
has an idea please advise. Thanks

Re: rewrite table cell content

David McDivitt wrote:
Quoted text here. Click to load it

The solution is simple: it's innerHTML, not innerHtml :)

Re: rewrite table cell content

Quoted text here. Click to load it

Thank you very much! It works perfectly now.

Site Timeline