我有以下JSON結果:
這是天氣結果。
我的目標是先獲得城市名稱。
然後根據列表中的某個城市,要求物業
從嵌套的JSON結果獲取JSON對象
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"hourly": 1
,
"lang": 1
}
, "results": [
{
"name": "Al-Arz",
"city": "Al-Arz",
"state": "",
"country": "LB",
"country_iso3166":"LB",
"country_name":"Lebanon",
"zmw": "00000.1.40105",
"l": "https://stackoverflow.com/q/zmw:00000.1.40105"
}
,
{
"name": "Beirut",
"city": "Beirut",
"state": "",
"country": "LB",
"country_iso3166":"LB",
"country_name":"Lebanon",
"zmw": "00000.1.40100",
"l": "https://stackoverflow.com/q/zmw:00000.1.40100"
}
,
{
"name": "Dahr Baidar",
"city": "Dahr Baidar",
"state": "",
"country": "LB",
"country_iso3166":"LB",
"country_name":"Lebanon",
"zmw": "00000.1.40110",
"l": "https://stackoverflow.com/q/zmw:00000.1.40110"
}
,
{
"name": "Houche-Al-Oumara",
"city": "Houche-Al-Oumara",
"state": "",
"country": "LB",
"country_iso3166":"LB",
"country_name":"Lebanon",
"zmw": "00000.1.40101",
"l": "https://stackoverflow.com/q/zmw:00000.1.40101"
}
,
{
"name": "Merdjayoun",
"city": "Merdjayoun",
"state": "",
"country": "LB",
"country_iso3166":"LB",
"country_name":"Lebanon",
"zmw": "00000.1.40104",
"l": "https://stackoverflow.com/q/zmw:00000.1.40104"
}
,
{
"name": "Rayack",
"city": "Rayack",
"state": "",
"country": "LB",
"country_iso3166":"LB",
"country_name":"Lebanon",
"zmw": "00000.1.40102",
"l": "https://stackoverflow.com/q/zmw:00000.1.40102"
}
,
{
"name": "Tripoli",
"city": "Tripoli",
"state": "",
"country": "LB",
"country_iso3166":"LB",
"country_name":"Lebanon",
"zmw": "00000.1.40103",
"l": "https://stackoverflow.com/q/zmw:00000.1.40103"
}
]
}
}
我怎樣才能得到所有城市的名字嗎?
在此先感謝。
非常感謝! – EFK10003 2015-02-12 15:35:26
很高興幫助;) – vinitius 2015-02-12 15:35:47