console.log这样提示:data: '{"site_name":"aaaa","site_keywords":"bbbb","site_beian":"闽ICP备8888888888号","site_description":"ccccc","site_statistic":"<a>wsdfadfasdfasdfasdfasdf</a>"}',从mysql获取json数据,这碰到这个问题,前端怎么处理转换解析json类型?
1 回答
森栏
TA贡献1810条经验 获得超5个赞
Convert String to JSON object :
1 var res = JSON.parse(data);
or
2 var res = data.parseJSON();
or
3 var res = eval('('+ data +')');
添加回答
举报
0/150
提交
取消