"user_id"를 입력으로 사용하고 Js 함수로 전달하여 프로필 사진 데이터를 제공합니다. 사진을 표시하려고합니다. 로그인 사용자 프로필 사진이 제대로 표시됩니다. 하지만 내가 user_id를 로그 아웃 할 때 오류가 발생하고 "TypeError : response.picture is undefined"라고 표시됩니다. 처음으로 fb api를 사용하여 user_id 만 사용자 정보를 얻으려고합니다. 여기는 내 기능입니다. "a"가 입력됩니다.Facebook Api는 facebook을 제공하여 사용자 프로필 사진을 얻습니다. user_id
// without login,just giving username and getting profile picture
function getInfopeople(a) {
//https://graph.facebook.com/user_id/picture /me/picture?redirect=false&height=300' //this part is not working
var user_id = "/"+a + "/picture";
console.log(user_id);
FB.api('/http://graph.facebook.com/user_id,','GET', {fields:'picture.width(150).height(150)'}, function(response) {
document.getElementById('user_status').innerHTML = "<img src='" + response.picture.data.url + "'>";
});
}
앱을 인증하지 않은 사용자의 ID (또는 다른 것)를 가져 오지 않아도되므로 ID를 어떻게 얻었습니까? – luschn
입력 양식에 ID가 입력됩니다. 어쨌든, 나는 그것을 해결했다. 협조 해 주셔서 감사합니다.) : –