V
V
Viktor Klimov2017-02-04 19:43:34
JavaScript
Viktor Klimov, 2017-02-04 19:43:34

How to overcome error in JS "Uncaught SyntaxError: Unexpected token & in JSON at position 1"?

We have an array of data in PHP , return a string containing a JSON representation of the data using json-encode

.... some manipulations .. Get this string in JS ... Printed it to the console to check how it looks.
Start
ac1dfe43c3d74df292d6463528e73b41.png
End 15fc3c949cc049c8a114bff4354d83bb.png

I'm trying to make an object from this string using JSON.parse I'm getting an
error ((
f732915d726541cfa647f84cae9a4db4.png

I don't know what the problem is Escaping the
inner quotes (\")

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question