highlander (1) [Avatar] Offline
#1
Unknown runtime error trying to append to innerHTML of <TBODY> element
I am retrofitting some AJAX techniques into an existing web-delivered application, and have a requirement to add new rows to an existing <TABLE> element.

I use a HTTPRequest to get the HTML for the <TR> element that I need to add and use the following javascript to add it:

document.getElementById("fieldTable").innerHTML += this.req.responseText;

This produces an "Unknown runtime error".

Oddly, the innerHTML method works just fine when the element I am modifying is a DIV. Just seems to be elements that contain child elements that are the problem.

Any help would be greatly appreciated.

Message was edited by:
Pascarello
Pascarello (208) [Avatar] Offline
#2
Re: Unknown runtime error trying to append to innerHTML of &lt;TBODY&gt; element
Table elements are a little different than other elements. You are probably going to have to bite the bullet and look through using insertRow and insertCell to get the content in the table.

Eric

Message was edited by:
Pascarello