string in question:
'{"images":{"0":"<div style=\\"background:red;width:250px;height:250px;display:block;position:absolute;\\"></div>"}}'
I’ve tried various combinations of single and double quotes. If you plop that string into Chrome’s javascript console, into JSON.parse(), it parses fine.
Problem is, that string is sent to me from a server, I get it via an .xhr() request. As soon as that step is added, no matter the permutations of single and double quotes I keep getting errors like:
Unexpected Token ‘
How do I request a string like that and JSON.parse it to an object?
If you quote is part of the string, then it’s not json. remove the starting and closing quotes.
And there is no reason to double escape the double quotes.