Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在对一些 JSON 进行简单解析,它在 chrome 中给了我一个错误,我在这里缺少什么?
Ext.util.JSON.decode("{info: {synopsis: 'test'}}"); SyntaxError: Unexpected token ILLEGAL
非常感谢
http://www.json.org/
认为您应该使用双引号而不是单引号。
Ext.util.JSON.decode('{"info": {"synopsis": "test"}}');
如果你使用 ExtJs 4 以后要小心,你必须使用
Ext.JSON.decode('{"info": {"synopsis": "test"}}');