JS의 간단한 비트가 .json 파일의 항목 수를 세는 것을 찾습니다 (이 경우 각 항목은이 경우 웹 애플리케이션에 인스 트램 사진이 표시됨을 나타냅니다. 사진 수를 센다). Json은 구조적으로 ...json 배열의 항목 수
{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"geometry":{
"coordinates":[
-79.40916,
43.87767
],
"type":"Point"
},
"properties":{
"longitude":-79.40916,
"latitude":43.87767,
"title":"",
"user":"cmay2400",
"id":"176051485697457528_13947894",
"image":"http:\/\/distilleryimage0.instagram.com\/1d725a3a8d7511e181bd12313817987b_7.jpg",
"images":{
"low_resolution":{
"url":"http:\/\/distilleryimage0.instagram.com\/1d725a3a8d7511e181bd12313817987b_6.jpg",
"width":306,
"height":306
},
"thumbnail":{
"url":"http:\/\/distilleryimage0.instagram.com\/1d725a3a8d7511e181bd12313817987b_5.jpg",
"width":150,
"height":150
},
"standard_resolution":{
"url":"http:\/\/distilleryimage0.instagram.com\/1d725a3a8d7511e181bd12313817987b_7.jpg",
"width":612,
"height":612
}
},
"description":"Today's ride <span class=\"tag\">#zipcar<\/span>",
"instagram_id":"13947894",
"likes":1,
"profile_picture":"http:\/\/images.instagram.com\/profiles\/profile_13947894_75sq_1322267355.jpg"
}
},
{
"type":"Feature", [...]
단지 json 파일을 반복하고 항목 수를 계산하려고합니다. 어디서부터 시작해야할지 모릅니다.
그렇다면 우리는 어떤 속성을 계산 하시겠습니까? – xandercoded
정확히 어떤 아이템을 계산하려고합니까? – natlee75
JS 객체에 .json 파일을 이미로드 했습니까? –