I'm fairly new to JavaScript. I used this to Jasonify an array:
<script>
var numobjects = jQuery.parseJSON('{{result|jsonify}}');
</script>
and the result is correct:
jQuery.parseJSON
('[
{"category": "Perfumes", "comments": [good]},
{"category": "Perfumes", "comments": [ok]},
{"category": "Perfumes", "comments": [I like it!]}
]');
I don't now how to get the "comments" object using JavaScript. I tried something like this: Getting JavaScript object key list
<script>
var numobjects = [jQuery.parseJSON('{{result|jsonify}}')];
var com = [];
for (var comments in numobjects) com.push(comments);
{
console.log("total " + com.length + " comments: " + comments);
}
</script>
Thank you for the help