JavaScriptを使用してJSONのすべての名前属性を取得するにはどうすればよいですか?json属性を取得できません
{
"layerGroup": {
"name": "tasmania",
"mode": "SINGLE",
"title": "Tasmania",
"abstractTxt": "Tasmania Australia from Digital Chart of the World.",
"publishables": {
"published": [{
"@type": "layer",
"name": "tasmania_state_boundaries",
"href": "http:\/\/localhost:8080\/geoserver\/rest\/layers\/tasmania_state_boundaries.json"
}, {
"@type": "layer",
"name": "tasmania_water_bodies",
"href": "http:\/\/localhost:8080\/geoserver\/rest\/layers\/tasmania_water_bodies.json"
}, {
"@type": "layer",
"name": "tasmania_roads",
"href": "http:\/\/localhost:8080\/geoserver\/rest\/layers\/tasmania_roads.json"
}, {
"@type": "layer",
"name": "tasmania_cities",
"href": "http:\/\/localhost:8080\/geoserver\/rest\/layers\/tasmania_cities.json"
}]
},
"styles": {
"style": ["null", "null", "null", "null"]
},
"bounds": {
"minx": 143.83482400000003,
"maxx": 148.47914100000003,
"miny": -43.648056,
"maxy": -39.573891,
"crs": "EPSG:4326"
},
"metadata": {
"entry": {
"@key": "rawStyleList",
"$": ""
}
}
}
}
これまでに試したことをお伝えください。 –
アラート(data.layerGroup.name;)はタスマニアのみを出力します。すべての名前をアトリビュートにしたい –
Object.keys –