Say I have a json object that looks like
"bounds":{
"coordinatetop":{
"x":143,
"y":544
},
"coordinatebottom":{
"x":140,
"y":510
}
}
I am trying to parse the JSON currently with this code, where data is the json data and target is just an tag id.
$.each(data, function(index, value) {
if (typeof(value) == 'object') {
processBounds(value, target);
} else {
console.log(value);
}
});
When I loop through this, the function call takes the values coordinatetop and target, followed by the value of x and y which are 143 and 544. However, this function does not loop far enough to get the values of coordinatebottom.
What are other ways of implementation to make that possible? Thanks