I have this problem: I have an HTML textarea which is filled by the user. (And he can press The enter button to go on a new line). Then I take The value of The textarea using the command:
document.getElementById("textareaCommento")
And I pass The value to the servlet using an XmlHttpRequest. In The servlet I save this value in a database. Since this point I have no problems...
Then, in another part I want to get The values from The database. Using a servlet I make this query
Select * from comments
And I transform the results in json. Here I have The problem... The newline character makes my JSON string invalid. For example:
"Comment":"hello
Word"
How can I do? Thanks in advance!
? – Martina Oct 24 '12 at 08:13
. it don't go on a new line...:( – Martina Oct 24 '12 at 08:22