87,996
社区成员




d = [{
"thisNode": "10000480",
"prientNode": "",
"qx": "0",
"children": [
{
"prientNode": "10000480",
"thisNode": "10000470",
"qx": "0",
"children": []
},
{
"prientNode": "10000480",
"thisNode": "10000420",
"children": [
{
"prientNode": "10000420",
"thisNode": "10000551",
"qx": "1",
"children": [
{
"prientNode": "10000420",
"thisNode": "10000551",
"qx": "1",
"children": []
}
]
}
]
}
]
}
];
function findChildren(arr, key, value,callback) {
for (var i = 0; i < arr.length; i++) {
if (arr[i][key] == value) callback(arr[i].children)
findChildren(arr[i].children, key, value, callback);
}
}
findChildren(d, 'qx', '1', function (children) {
console.log(children)
});