I receive the answer ajax from the server in json format of the following form: {"success":true,"data":{"answer":"first line\r\nsecond line boom\r\n123","answer_id":433}}
Then I scatter the data under the places in the formation of the html block and output, i.e. in the right place eg + respose.data.answer +
The problem is that the text in this case is my text, i.e. there are spaces, but line breaks do not work.
There was a thought to insert and replace \n with <br> before inserting into the html regular, but I think this is clearly the wrong solution. How to be?
\r\nto<br>- no way.\r\nistext/plain, and<br>istext/html, if you do not explicitly specifytext/plainheaders, the browser will not display any hyphenation, unless of course you can go toview-source:http://site.ru/- then you will see hyphenation, well, or throw it intextarea=) - And