I have a json object with html markup and many escaped characters as follows,
[{
"status": "PASS",
"server_name": "sk-vbox",
"start_time": "20150528 11:49:49 Hrs",
"summay_html": "<a href=\"#sk-vboxSgTcInitiatorStartTest\">Summary</a>",
"end_time": "20150528 11:49:51 Hrs",
"log_html": "<a class=\"log\" href=\"log.html#s1-s2-s1\">Logs</a>",
"suite": "Sg Tc Initiator Start Test",
"error_msg": "-"
}]
I am trying to parse it using JSON.parse as follows:
var a = JSON.parse('[{"status": "PASS", "server_name": "sk-vbox", "start_time": "20150528 11:49:49 Hrs", "summay_html": "<a href=\"#sk-vboxSgTcInitiatorStartTest\">Summary</a>", "end_time": "20150528 11:49:51 Hrs", "log_html": "<a class=\"log\" href=\"log.html#s1-s2-s1\">Logs</a>", "suite": "Sg Tc Initiator Start Test", "error_msg": "-"}]')
It throws error as,
JSON.parse: expected ',' or '}' after property value in object at line 1 column 111 of the JSON data
I read here, one can escape double quotes by single backward slash but it doesnt work.