Skip to content Skip to sidebar Skip to footer

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 tok

Solution 1:

http://www.json.org/

Think you should use double quotes instead of single quotes.

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

Solution 2:

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

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

Post a Comment for "Parsing Simple Json Using Ext Gives Syntaxerror: Unexpected Token Illegal"