I have a user entered JSON data which is then saved to other object. But instead of JSON I get dtExport: \'{\\\\\"type\\\\\":\\\\\"polyline\\\\\"}.
dtExport: \'{\\\\\"type\\\\\":\\\\\"polyline\\\\\"}
How can
var x = '{\"type\":\"polyline\"}'; x = x.replace(/\"/g, "\"");
and next JSON.parse
results:
"{"type":"polyline"}"