我需要从json字符串创建JSON对象。我试图JSON.parse(json-string)
但我得到的错误:流星从json字符串创建JSON对象
SyntaxError: Unexpected token o
但是当我运行在Android的JSONObject(json-string)
相同的字符串,我得到一个没有错误
HTTP.get(url, function (error, response) {
if (response) {
var content = JSON.parse(response);
console.log(content);
难道我做错了什么? response
是否包含json-string而没有其他未修改?谢谢
什么是您的JSON是什么样子? –
它包含单引号,当我在终端中使用console.log时,它在每个单引号前加上“\”。 –