2013-06-10 3 views

답변

1

industryIdentifiers가 배열 반환 방법은 말한다 API에서 문서입니다 이름이 아닌 :

var industryIdentifiers = bookDetails.volumeInfo.industryIdentifiers; //get a reference to the array for brevity 

for(var i=0; i< industryIdentifiers.length; i++) { //loop through all industryIdentifiers 
    var type = industryIdentifiers[i].type; //access industryIdentifiers by index 
    if(type === 'ISBN_10') { //test if this is the ISBN_10 identifier 
     $('#ISBN').text(type); 
    } 
} 
+0

'for var i = 0; i

+0

이 작동하지 않습니다. ISBN_10 유형을 추출하여 선택기에 할당하는 방법을 알아낼 수 없습니다. –

+0

@LaliPali 사용하려고 시도했기 때문에 댓글에 올린 스 니펫이 작동하지 않습니다. 'identifier'라는 변수는 존재하지 않습니다. 'type' 프라퍼티를 얻으려면 인덱스에 의해'industryIdentifiers' 배열에 접근해야합니다 :'$ ('# ISBN'). text (industryIdentifiers [i] .type);'이 배열은 배열입니다. 두 개 이상의 식별자를 가지고 있습니다 – cfs