rewrite table cell content

D

David McDivitt

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
 
D

David McDivitt

From: Mitja Trampus said:
Date: Wed, 14 Jun 2006 19:04:21 +0200
Lines: 5



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

Thank you very much! It works perfectly now.
 

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top