json和换行符

I hope, there is a solving of my question. But I can't find it. Problem: ajax return data with line break ( ). The data must be insert into textarea and will be update from ajax.

I can replace ' ' when reading data (myJsonData.replace.() ... etc). The main problem: how to ready data for textarea to display in correct format with line break?

just replace it to something revertable, like -=br=- and when insert to the textarea, replace back to

There is no problem with line breaks in textarea and you just can insert the data as is. But if you still have problems with special chars - you can encode your JSON data and decode it on insert.