Display raw HTML/XML in table

Display raw HTML/XML in table

blahblahblahblahblahblah Posts: 1Questions: 0Answers: 0
edited January 2012 in DataTables 1.9
Hi,

I am trying to display xml inside a cell but it strips all the xml tags, is there a way to get it to display?

[code]
"aoColumns": [
{ "mDataProp": "DateReceived", "sType": 'date' },
{ "mDataProp": "MessageBody",
"fnRender": function (oObj) { alert('' + oObj.aData.MessageBody + ''); return '' + oObj.aData.MessageBody + ''; }

},
{ "mDataProp": "LastError" },
{ "mDataProp": null }
[/code]

The alert for each row shows the data as it should be with xml tags but when it gets put in the table it's had the tags removed, any ideas?

Thanks

Replies

  • allanallan Posts: 61,663Questions: 1Answers: 10,095 Site admin
    The data is put into the cell using innerHTML - so is it likely to be that which is causing the problem? The browser doesn't know about your XML tags, and thus removes them? Not 100% sure I'm afraid. Are your HTML entities escaped? i.e. is "<" actually "<" in your string? If not then I'd suggest doing that.

    Allan
  • codoc1010codoc1010 Posts: 1Questions: 0Answers: 0
    Hi all,
    Please give me your code about using innerHTML to show special data like "<", "&amp", "&lt". I try, but i cann't do.
    Thanks!
This discussion has been closed.