I am struggling with parsing this JSON object:
{
"key1" : "value",
"key2" : "{ "innerkey1": "value", "innerkey2": "value"}"
}
Here is an example of how I am trying to parse it:
var myData = JSON.parse(data);
$(document).ready(function() {
var $grouplist = $('#groups');
$('<li>' + myData.key1 + '</li>').appendTo($grouplist);
});
However, when I try to use JSON.parse
, I keep getting a parse error in the console.
Here is a sample code that replicates the issue: https://jsfiddle.net/2L8dLtfq/