我需要加载一个JSON文件(完成),然后解析它以访问数据以加载可折叠力布局的链接。
//Load json from local server
$.getJSON("simulator.json", function(json) {
console.log(json);
});
答案 0 :(得分:-1)
通常JSON会像这样循环:
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]);
}
}