1
size:large
의 URL에 도달하기 위해 JSON 배열을 탐색하려고합니다. #text
속성은 내 점 표기법에 포함 할 수 없기 때문에 혼란 스럽습니다. 나는이 함께 size=large
얻을 수 있습니다 :Json parse #text object
json.track.album.image[2].size
하지만 json.track.album.image[2].#text
이 작동하지 않습니다. 여기
json.track.album.image[2]['#text']
이 같은 키를 지정하려면 때문에 최고의 #
의
{"track":{"id":"1019817","name":"Believe","mbid":"13194c93-89c6-4ab4-aaf2- 15db5d73b74e","url":"http:\/\/www.last.fm\/music\/Cher\/_\/Believe","duration":"222000","streamable":{"#text":"1","fulltrack":"0"},"listeners":"287271","playcount":"1206650","artist":{"name":"Cher","mbid":"bfcc6d75-a6a5-4bc6-8282-47aec8531818","url":"http:\/\/www.last.fm\/music\/Cher"},"album":{"artist":"Cher","title":"The Very Best of Cher","mbid":"5df00011-6e57-4837-99ae-61f398481db5","url":"http:\/\/www.last.fm\/music\/Cher\/The+Very+Best+of+Cher","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64s\/71997588.png","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/71997588.png","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/174s\/71997588.png","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/300x300\/71997588.png","size":"extralarge"}],
제임스 감사합니다. 모든 JS 같은 답변은 항상 간단하지만 거기에 점점 ... – hillcreative