JSON string with some html tag failing at parse

I am taking user input sending it to server using jQuery ajax...after inserting user values in database I am sending response back to client as JSON string as following > echo '{"success":"true","data":"'.nl2br($a).'","type":"text"}'; as user input can contain new line, I am using nl2br so that all new line characters are converted to
and also know that JSON doesnt support multi line, thats why I am using nl2br....but parsing is failing at client side pls tell me what the reason and how can I solve it? parsing code `var obj = jQuery.parseJSON(data);`
Could you show the full response as received by the client?

以上就是JSON string with some html tag failing at parse的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准