问题
I have a user entered JSON data which is then saved to other object. But instead of JSON I get dtExport: '{\\"type\\":\\"polyline\\"}
.
How can I fix it? Thanks.
回答1:
var x = '{\"type\":\"polyline\"}'; x = x.replace(/\"/g, "\"");
and next JSON.parse
results:
"{"type":"polyline"}"
来源:https://stackoverflow.com/questions/31640767/javascript-json-parse-unescape-quotes