I'm stringyfing an object like {'foo': 'bar'}(我正在像{'foo': 'bar'}这样的对象。)
{'foo': 'bar'}
You need to JSON.parse() the string.(你需要JSON.parse()字符串。)
JSON.parse()
var str = '{"hello":"world"}'; try { var obj = JSON.parse(str); // this is how you parse a string into JSON document.body.innerHTML += obj.hello; } catch (ex) { console.error(ex); }
1.4m articles
1.4m replys
5 comments
56.9k users