family = {
'person1':[{"id":"1111","name":"adam", "sex":"male", "born":"USA"}],
'person2':[{"id":"2222","name":"sarah", "sex":"female", "born":"Canada"}],
'person3':[{"id":"3333","name":"adam", "sex":"male", "born":"USA"}]
};
鑑於上述家族對象,我如何提取其中一個人物對象的所有屬性(id,name,sex,born)一個特定的id(或名稱)值?比如:id = 1111用javascript/jquery查找大對象內的對象及其屬性
所以最好我能得到一個新的對象personInQuestion我可以操縱,其中:
personInQuestion = {"id":"1111","name":"adam", "sex":"male", "born":"USA"}
謝謝,看起來它會很好地工作。乾杯 – 2012-07-24 16:40:36
不客氣,很高興我可以幫忙:-D – 2012-07-24 16:40:54