从mysql获取json数据,前端怎么处理转换解析json类型

console.log这样提示:

data: '{"site_name":"aaaa","site_keywords":"bbbb","site_beian":"闽ICP备8888888888号","site_description":"ccccc","site_statistic":"<a>wsdfadfasdfasdfasdfasdf</a>"}',

从mysql获取json数据,这碰到这个问题,前端怎么处理转换解析json类型?

繁花如伊
浏览 393回答 1
1回答

森栏

Convert String to JSON object :1&nbsp; &nbsp; var res = JSON.parse(data);&nbsp;or2&nbsp; &nbsp; var res = data.parseJSON();or3&nbsp; &nbsp; var res = eval('('+ data +')');
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript