のJSON配列は、私はこのようなJSONを持っている:解析JSONは - 配列
{
"cod":"200",
"message":0.0085,
"cnt":37,
"list":[
{
"dt":1492074000,
"main":{
"temp":8.74,
"temp_min":8.39,
"temp_max":8.74,
"pressure":1002.4,
"sea_level":1023.01,
"grnd_level":1002.4,
"humidity":94,
"temp_kf":0.35
},
"weather":[
{
"id":500,
"main":"Rain",
"description":"Lekki deszcz",
"icon":"10d"
}
],
"clouds":{
"all":32
},
(...)
JSON.parse(json.list[0]['weather'][0].description);
//OR
JSON.parse(json.list[0]['weather'][0]['description']);
を私は何を取得します。しかし、もし私がこの配列 "id":500にintにアクセスしたいなら、すべては大丈夫です。
JSON.parse(json.list[0]['weather'][0].id);
この具体的な例では、文字列の解析に問題があるようです。