I have the following JSON obj/code:
However it doesn't return/prompt anything. I've tried a few different variations and just can't for the life of me remember how/if I can access an object property through this sort of method.
What am I missing?
Code:
var json_logs =
{
"countries": [ "US","AU"],
"US":{"num_calls":"555","time":"432"},
"AU":{"num_calls":"212","time":"233"}
}
var call = json_logs.evalJSON();
for(i=0;i< call.countries.length; i++){
alert(call[countries[i]].num_calls);
}
What am I missing?
Comment