I need to load a JSON file (done) and then parse it in order to access the data to load the links of a Collapsible Force Layout.
//Load json from local server
$.getJSON("simulator.json", function(json) {
console.log(json);
});
I need to load a JSON file (done) and then parse it in order to access the data to load the links of a Collapsible Force Layout.
//Load json from local server
$.getJSON("simulator.json", function(json) {
console.log(json);
});
Usually the JSON is gone over in a loop like so:
for(a in json){
//see a child object like this
console.log(json[a]);
//if it has a property, you can acccess it like so:
link = json[a].link;
//if it has child objects you can continue to iterate
for(b in json[a]){
console.log(json[a][b]);
}
}