Accepted answer

it's because you're using json.parse to try to parse an array, which is not going to work. just get rid of the json.parse, and this should work as expected.

when you call json.parse on something that's not a string, it's going to coerce it to a string by calling .tostring() on it. if valpair = [1234567, 0], then valpair.tostring() is going to yield 123457,0 (this is probably dependent on the js engine: i get 123457,0 in chrome). this is invalid json: the "unexpected non-whitespace character" is the comma.

Related Query

More Query from same tag