【发布时间】:2017-10-05 17:18:10
【问题描述】:
我这里有一些代码 json。
[
{
"id": "Node-1",
"label": "Node-1",
"image": "img/hosts.png",
"shape": "image",
"description": "Node-1:type: OS::Nova::Serverproperties: image: {get_param:image} flavor: {get_param:flavor}"
},
{
"id": "Switch-1",
"label": "Switch-1",
"image": "img/switch.png",
"shape": "image",
"description": "Switch-1:type: OS::Neutron::Netproperties: name:Switch-1Switch-1_subnet:"
}
]
如何使用 javascript 获取“描述”值?
【问题讨论】:
-
你如何加载 json
-
您可以将 Json 分配给变量并将其作为数组中的属性读取。例如:Json[1]。描述
标签: javascript arrays json parsing jsonparser