Hi,
I have started using xmlhttprequests and post data to a server side program that then generates XML and sends it back to the page. The XML is actually something like this:
<xmldata>
<tbody>
<tr id="row1" onClick="rowSelect(1,'0x000eac01');">
<td id="row1cell1" bgcolor="#b7bceb">000000317</td>
<td id="row1cell2" bgcolor="#a8adde">Al</td>
</tr>
</tbody>
</xmldata>
As you can see, apart from the <xmldata> tags its HTML, and I basically want to attach this HTML into the document as it is. I assumed I could get all the nodes under <xmldata> and append it to my HTML in Javascript like so:
var oNewNode = theXML.getElementsByTagName('xmldata')[0];
timesheetbody.appendChild(oNewNode);
Unfortunately all this seems to do is throw all of the text from each of the tags into one cell, so from the above example I get "000000317 Al" in the cell. Rather than attaching the actual HTML.
Anyone got any ideas?
Thanks,
Mark
I have started using xmlhttprequests and post data to a server side program that then generates XML and sends it back to the page. The XML is actually something like this:
<xmldata>
<tbody>
<tr id="row1" onClick="rowSelect(1,'0x000eac01');">
<td id="row1cell1" bgcolor="#b7bceb">000000317</td>
<td id="row1cell2" bgcolor="#a8adde">Al</td>
</tr>
</tbody>
</xmldata>
As you can see, apart from the <xmldata> tags its HTML, and I basically want to attach this HTML into the document as it is. I assumed I could get all the nodes under <xmldata> and append it to my HTML in Javascript like so:
var oNewNode = theXML.getElementsByTagName('xmldata')[0];
timesheetbody.appendChild(oNewNode);
Unfortunately all this seems to do is throw all of the text from each of the tags into one cell, so from the above example I get "000000317 Al" in the cell. Rather than attaching the actual HTML.
Anyone got any ideas?
Thanks,
Mark