I have files.json like this
{
"apple": "apple789121.json",
"banana": "banana537332.json",
"cherry": "cherry236832.json"
}
I want to load json on javascript, like
var fruit = apple;
$.getJSON("files.json", function(data){
//if key of files.json same with fruit variable
if(data.key == fruit){
//load json based on value of key
$.getJSON(data.fruit, function(result){
console.log("success");
})
}
})
Anyone help me please, thank you.