Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
413 views
in Technique[技术] by (71.8m points)

使用ueditor编辑器 编辑入库的数据 变成json后解析失败 大神来看看

使用ueditor编辑器 编辑入库的数据 变成json后解析失败 大神来看看 [{"ad_id":"4","ad_name":"u597du7684u5e7fu544a","ad_images":"http://lemi.zhe.com/Upload/2017-02-12/58a060297e20f.png","ad_content":"<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; u5e7fu544a2u5e7fu544a2<img src="http://img.baidu.com/hi/jx2/j_0016.gif"/> &nbsp;<img src="http://img.baidu.com/hi/jx2/j_0072.gif"/><img src="http://img.baidu.com/hi/jx2/j_0052.gif"/> &nbsp; &nbsp;&nbsp;u597du7684u5e7fu544au597du7684u5e7fu544au597du7684u5e7fu544au597du7684u5e7fu544a</p>","sort":"1"},{"ad_id":"5","ad_name":"u7ed3u5a5au5728u6625u5b63","ad_images":"http://lemi.zhe.com/Upload/2017-02-12/58a0603506f04.png","ad_content":"<p>u9876u9876u9876u9876<img src="http://img.baidu.com/hi/jx2/j_0047.gif"/><img src="http://img.baidu.com/hi/jx2/j_0050.gif"/><img src="http://img.baidu.com/hi/jx2/j_0044.gif"/>u7ed3u5a5au5728u6625u8282</p>","sort":"2"}]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

这是因为你的ad_content字段里面的img标签的"没有呗转义,导致json解析失败,所以你要去看看在转换成json的时候这个地方是否有默认做处理~!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...