I am hesitant to ask this, because it has been asked so many times already, but I've yet to figure it out. I have what I think is a very simple nested JSON object that I would like to display in my html file.
JSON object is as follows:
{
"data": {
"listItem1": {
"listName": "Goggles",
"listType": "Face"
},
"listItem2": {
"listName": "Gloves",
"listType": "Hands"
}
}
}
And here is the JQuery in my html file:
$(document).ready(function(){
$.getJSON('equipLists.json', processList);
function processList(data) {
var infoHTML ="";
$.each(data,function(listItem, listInfo) {
infoHTML += "<p>" + listInfo.listName + "</p><br>";
});
$('#ppeList').html(infoHTML);
}
});
#ppeList is just a div container in my html file. I know it's something simple, but I just can't for the life of me figure it out. Thanks for any help.