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.
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.
Share Improve this question asked Jul 26, 2015 at 19:00 fivepointsevenfivepointseven 1,0512 gold badges11 silver badges23 bronze badges 1- 1 Please post the problematic code. – Mike Samuel Commented Jul 26, 2015 at 19:01
1 Answer
Reset to default 5var x = '{\"type\":\"polyline\"}'; x = x.replace(/\"/g, "\"");
and next JSON.parse
results:
"{"type":"polyline"}"
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744309776a4567891.html
评论列表(0条)