I have the following object being returned from a web service:
{
"temperature": {
"trend": "-1",
"critical_in": "-1",
"avg": "20.7",
"status": "1",
"curr": "25.0",
"advises": [
]
},
"ph": {
"trend": "-1",
"critical_in": "-1",
"avg": "8.07",
"status": "0",
"curr": "8.12",
"advises": [
]
},
"nh3": {
"trend": "0",
"critical_in": "-1",
"avg": "0.008",
"status": "0",
"curr": "0.001",
"advises": [
]
},
"light": {
"max_value": "1065.7",
"status": "0",
"curr": "12.1986",
"advises": [
]
}
}
I'm unsure on how to read it using jquery?
Here is what I currently have. I've tried other things but I cannot seem to figure this out. I'm trying to get the "Temperature > avg"
$.getJSON('https://api.seneye.com/v1/devices/44277/exps?user=xxxxxxx&pwd=xxxxxx', function (json) {
// console.log(response);
console.log(json);
var statusHTML = '<ul class="bulleted">';
$.each(json, function (i, params) {
statusHTML += '<li class="out">';
statusHTML += params.temperature;
statusHTML += '</li>';
});
statusHTML += '</ul>';
$('#employeeList').html(statusHTML);
}); // end get json
Any help is appreciated.