1
임 현재 지금과 같은 JSON을 통해 오픈 그래프의 URL 요청 :반복
이https://graph.facebook.com/me/friends?fields=email,likes,name,birthday,location,website&access_token=$token
내 JSON 요청이 성공적인이다, 그러나 나의 문제입니다 해당하므로 반환 된 데이터를 통해 실제로 루프, 나는 내 페이지에 그것을 나열 할 수 있습니다. 이 같은 모습
$('#goButton').click(function() {
//Call the JSON feed from the Open Social Graph.
$.getJSON("https://graph.facebook.com/me/friends?fields=email,likes,name,birthday,location,website&access_token=" + savedFbToken + "&callback=?",
//Once it is returned, do something with the JSON:
function (data) {
console.log(data);
//Clear out the placeholder
$('#Placeholder').html("");
//Add some new data
$('#Placeholder').append("<h1>Name:</h1>" + data.name + "");
$('#Placeholder').append("<span>Birthday: "+ data.birthday +"</span><br/>");
$('#Placeholder').append("<span>Location: "+ data.location +"</span><br/>");
$('#Placeholder').append("<span>Id: "+ data.id +"</span><br/><br/>");
});
});
형식 반환 방법 : 루프에
{
"data": [
{
"name": "Name 1",
"birthday": "10/08/1983",
"location": {
"id": "110343502319180",
"name": "Copenhagen, Denmark"
},
"id": "263901486"
},
{
"name": "Name 2",
"birthday": "02/16/1982",
"location": {
"id": "110398488982884",
"name": "Reykjav\u00edk, Iceland"
},
"id": "502533736"
},
etc...
어떤 제안이 제대로을 통해
나는 다음과 같이 시도했습니다?
을 통해 루프 필요 - 쉬웠다! 무리 감사 :) – user1231561