I have this file json where I have, for each event (when), some reaction (do):
{"title":"Building blocks",
"date":"'1452786221'",
"scenes":[
[{
"when":{"event":"init"},
"goto":""
},
{
"when":{"event":"e_dTou","position":"up"},
"do":[
{"action":"a_dME","position":"open"},
{"action":"a_dME","position":"close"}
],
"goto":""
}
]
]}
I read this json from the file manifest.json with an ajax call so the data returned is text already parsed.
url = "json/manifest.json";
$.ajax({
type: "POST",
url: url,
success: function(data) {
console.log(data.scenes.when);
},
error: function() {
alert("Call" + url + " failed...");
}
});
With my code on console I have undefined
. I want to read every data of this json in JQuery and write it on console. How can I do it? Thank you in advance.