In an ajax call I request a text block(formatted with newlines) from the database. I confirmed its still formatted in the database and in the return ajax result(using firebug). But as soon as I do the following, all the newlines are stripped out:
doc.getElementById(‘myDiv’).innerHTML = myTxt.textContent
The div is defined as:
<div id=”myDiv” style=”display:inline”></div>
I’m wondering if there is a property of the div or in the way I am inserting that could help fix the problem. I did read on this forum that people frown on using .innerHTML. If not using it will fix this problem I’ll gladly change it to the correct method(whatever that may be).
Your help is appreciated.