Chris
Chris

Reputation: 40661

Parsing simple JSON using Ext gives SyntaxError: Unexpected token ILLEGAL

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

Upvotes: 1

Views: 8627

Answers (2)

Sid
Sid

Reputation: 713

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

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

Upvotes: 4

yoda
yoda

Reputation: 10981

http://www.json.org/

Think you should use double quotes instead of single quotes.

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

Upvotes: 7

Related Questions