Problem when retrieving text in JSON format containing line breaks with jQuery

前端 未结 9 2164
独厮守ぢ
独厮守ぢ 2020-12-02 18:05

I\'m having a strange problem when retrieving JSON formatted text. I use jQuery post to send some data (also JSON formatted) to the server (running PHP) which w

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 18:46

    You can also use

     tag that will keep all line breaks and white spaces.
    I am posting this answer because i also encounter that problem and for solutions i reached to this question and after that I randomly decided to use 
     tag instead of 
    and that solved by problem although at many places there were unwanted back slashes \

提交回复
热议问题