I have json data like this http://pastebin.com/k3a5UNsL
When viewed using the json formater, I want to take the data stored on the object using jquery inside possible_persons object.
I'm trying to loop into the data, but confused how do I get the data names, gender, addresses, etc...

When I use this code
function build_possible_persons(result) {
var relationship = result['possible_persons'];
$.each(relationship, function(key, value) {
$.each(value, function(sec_key, sec_value) {
alert(sec_value);
});
});
}
I get a result of the alert value of the results of the first loop, which as shown in Figure 0:25, 3788825f48716e6c ...., [object], [object], etc ....
How can I do a looping into the objects in it in order to get the value I want? I try
function build_possible_persons(result) {
var relationship = result['possible_persons'];
$.each(relationship, function(key, value) {
$.each(value, function(sec_key, sec_value) {
$.each(sec_key.names, function(third_key, third_value) {
alert(third_key);
});
});
});
}
or use
alert(sec_key.names[0].display);
But no luck. The code that I create show no results.
Please help to see the flaws in my code. Thanks