json字符串转json对象

var jsonstr = res.data;

jsonstr = jsonstr.replace(" ","");

if(typeof jsonstr!='object'){

  jsonstr = jsonstr.replace(/\ufeff/g,"")

 var jj = JSON.parse(jsonstr);

res.data =jj;

}

猜你喜欢

转载自blog.csdn.net/wangjiali123123/article/details/81105283