假设我有以下 JSON 文件:
[
{
"id" : "1",
"name" : "Super shirt",
"snippet": "Item description here",
"price" : "some price here",
"category" : "shirt",
"pic" : "picture1"
},
{
"id" : "2",
"name" : "Super duper",
"snippet": "Item description here",
"price" : "some price here",
"category" : "shirt",
"pic" : "picture2"
}
]
等等。如何根据每个对象的“id”属性获取“pic”属性的值?那么如果我有每个对象的 id,如何获取该对象的图片。
最佳答案
关于javascript - 如何根据另一个属性获取 JSON 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35408196/