Javascript JSON.parse Returns Unexpected token o Error Message

This error happens when you try to parse a returned JSON string in Javascript. Chances are, the string that want to parse as a JSON object is already parsed, hence the error message “Unexpected token o”.

The solution is to use the variable returned to you, say from an asynchronous call as a JSON Object rather than trying to parse it again.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *