I'm getting a 'Unexpected token' error in my JavaScript when parsing JSON. What does that mean?

Responsive Ad Header

Question

Grade: Education Subject: Support
I'm getting a 'Unexpected token' error in my JavaScript when parsing JSON. What does that mean?
Asked by:
95 Viewed 95 Answers

Answer (95)

Best Answer
(305)
An 'Unexpected token' error usually indicates a syntax error in the JSON string you're trying to parse. The JavaScript parser encountered a character or symbol it wasn't expecting based on the JSON grammar. Carefully review the JSON string for missing commas, incorrect quotes, or other syntax violations.