0
FB API를 사용하여 의견을 얻으려고합니다. 내가 얻은 json은 정확하지만 json을 통해 반복하는 데 문제가 있습니다. 여기 JSON을 통한 페이스 북의 의견,
내 JS입니다 : -$(document).ready(function() {
$('.showcomments a').click(function() {
var id = $(this).attr('id').split('-');
id = id[1];
$.ajax({
url: "https://graph.facebook.com/"+id+"/comments?access_token=foobar",
type: 'GET',
datatype: 'json',
success: function(comments) {
$.each(comments.data, function(i, comment){
alert('<h3>'+comment.from.name+'</h3><p>'+comment.message+'</p>');
});
}
});
});
});
나는 문제가 comments.data
불을 지르고과 생각은 다음과 제공 : - 어떤 도움
a is undefined
[Break On This Error] (function(a,b){function cv(a){return f...ndexOf(".")>=0&&(i=h.split("."),h=i.
건배를
'console.log (comments)'를'success' 콜백의 시작 부분에 넣으면 어떻게 될까요? – Blazemonger
{ "데이터": [{ "id": "foobar", "발신인": { "이름": "foobar", "id": "foobar"}, "메시지": "foobar", "created_time" "2011-11-08T14 : 31 : 22 + 0000"}], "paging": { "next": "https://graph.facebook.com/foobar/comments?access_token=foobar&limit=25&offset=25"}} – pjknight
http://jsfiddle.net/mblase75/bFY6y/ - 여기에서 잘 작동하는 것 같습니다. – Blazemonger