0

Hi I'm trying to parse my string to a json object, it wont work, I get a error when I debug the code, Syntax error, here is my variable I want to parse,

var myyVar = "{title: 'myTitle',root: {id:'1',title:'CEO',subtitle:'John Doe',children: [{ id: '2',title: 'COO',subtitle: 'Steve Berman',type: 'staff'},{ id: '3',title: 'CTO',subtitle: 'Mark Claskov',type: 'staff'},]}}"

$.parseJSON(myvar);

I dont get any json objects in return

Any thoughts?

closed as off-topic by Robert Lindgren Feb 18 '14 at 8:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions not specific to SharePoint are off-topic here, but can be asked on Stack Overflow." – Robert Lindgren
If this question can be reworded to fit the rules in the help center, please edit the question.

1

Despite the obvious difference in your variable name which I am assuming is a typo - try quoting your key fields. eg:

var myVar = "{'title': 'myTitle'}

Not the answer you're looking for? Browse other questions tagged or ask your own question.