{
"adult": false,
"budget": 17000000,
"crew": [
{
"credit_id": {},
"department": "Directing",
"id": 40223,
"job": "Director",
"name": "Joe Carnahan",
"profile_path": "/5YPrZ1JprLwtU4tn5DG0wqLjsAT.jpg"
},
{
"credit_id": "55444d6bc3a368573b0008ba",
"department": "Writing",
"id": 40223,
"job": "Writer",
"name": "Joe Carnahan",
"profile_path": "/5YPrZ1JprLwtU4tn5DG0wqLjsAT.jpg"
},
{
"credit_id": "52fe4482c3a36847f809a3ed",
"department": "Production",
"id": 2236,
"job": "Producer",
"name": "Tim Bevan",
"profile_path": "/f7o93O1KocuLwIrSa7KqyL1sWaT.jpg"
}
}
嗨! 這是tmdb php api的tmdb示例輸出。 如何使用jquery獲取董事姓名例如? 船員輸出的順序是隨機的。在JSON對象中查找具體值
可能重複[在JavaScript對象數組中查找對象的id](http://stackoverflow.com/questions/7364150/find-object-by-id-in-an-array-of- javascript-objects) – JJJ
'''var object = [your object]; var directors = []; Directors = jQuery.grep(object.crew,function(element,i){ return element.name ==='Director'; });'''如果船員中有幾個導演? – jedgard