Good day, I'm trying to run a simple getJSON to get information from data json, almost done but when running, get undefined in html
Here's my jquery :
$(document).ready( function() {
$.getJSON("/airport.json?code=bgw", function(data) {
$('#stage').html('<p> Name: ' + data.result.request.code + '</p>');
$.each(data.result.response.airport.pluginData.schedule.arrivals.data, function() {
$("ul").append("<li>Name: "+this['flight.status.text']+"</li><br />");
});
});
});
data json :
` {
"result": {
"response": {
"airport": {
"pluginData": {
"schedule": {
"arrivals": {
"data": [
{
"flight": {
"status": {
"live": true,
"text": "Estimated 13:44",
"icon": "green",
"estimated": null,
"ambiguous": false
}
}
}
]
}
}
}
}
}
}
}
`
Any ideas on what I might be doing wrong?
data json, There's no [request] key in your [data.result] object property. Is this your complete version of yourjson?