I'm pretty new to JavaScript and I have no idea how to access certain value in JSON string. I had lsit of these objects and I did access them by looping through with $.each
function. But it does not seem to work here. I've tried to do alert(data.type);
but it gives me undefined
variable.
TL;DR:
This is JSON string that I get via AJAX. How can I access type
value in JavaScript using jQuery?
{
"parent_id": "100003381460677",
"type": "post",
"title": "a",
"body": "b",
"date_normal": "01 May 2012"
}