使用Ext解析简单的JSON可以得到SyntaxError:Unexpected token ILLEGAL [英] Parsing simple JSON using Ext gives SyntaxError: Unexpected token ILLEGAL

查看:172
本文介绍了使用Ext解析简单的JSON可以得到SyntaxError:Unexpected token ILLEGAL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在简单地解析一些JSON,它给我一个chrome的错误,我在这里错过了什么?

i'm doing a simple parse of some JSON and it's giving me an error in chrome, what am i missing here?

Ext.util.JSON.decode("{info: {synopsis: 'test'}}");
SyntaxError: Unexpected token ILLEGAL

非常感谢

推荐答案

http://www.json.org/

认为您应该使用双引号而不是单引号。

Think you should use double quotes instead of single quotes.

Ext.util.JSON.decode('{"info": {"synopsis": "test"}}');

这篇关于使用Ext解析简单的JSON可以得到SyntaxError:Unexpected token ILLEGAL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆