Accepted answer

valid json strings require the property names to be quoted.

this can be corrected by quoting the property names like below:

json.parse('[{"x": 1, "y": 0}, {"x":2, "y":5, "marker": {"fillcolor":"red"}}, {"x":3, "y":8}]');


as it was said earlier json object names must to be quoted. so json.parse will parse only that string, valid json.

but if you can't for any reason change format of your string you can also parse it using eval function which can accept your syntax. but be careful! that's pretty good way for exploit.

Related Query

More Query from same tag