后台把一个Json类型的数据当成字符串返回到前台,但是到前台变成了下面的这个样子
"[{"name":"IE","y":72},{"name":"Firefox","y":35},{"name":"Chrome","y":110}]"
怎么转成一个JSON类型的数据
var json = "@ViewBag.json";
var d = document.createElement('div');
d.innerHTML = json;
json = d.innerText || d.textContent
json = JSON.parse(json);