admin管理员组

文章数量:1279117

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

Thanks a lot

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

Thanks a lot

Share Improve this question asked Feb 4, 2011 at 1:35 ChrisChris 40.7k46 gold badges195 silver badges239 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

http://www.json/

Think you should use double quotes instead of single quotes.

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

Be careful if you are using ExtJs 4 onward, You have to use

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

本文标签: javascriptParsing simple JSON using Ext gives SyntaxError Unexpected token ILLEGALStack Overflow