Reputation: 1051
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.
Upvotes: 2
Views: 9234
Reputation: 80
var x = '{\"type\":\"polyline\"}'; x = x.replace(/\"/g, "\"");
and next JSON.parse
results:
"{"type":"polyline"}"
Upvotes: 5