function photos(){
FB.api( "/{839506469483059}/photos", function (response) { if (response && !response.error) {
var photos_name = document.getElementById("statusq").innerHTML = response.picture;
}
}
);
}
Question posted in Facebook API
The official documentation for the Facebook APIs can be found here.
The official documentation for the Facebook APIs can be found here.
2
Answers
Try this:
FB.api("/839506469483059/photos", ...
Put a
console.log(response)
in the callback to see any error or data. You will get an array of pictures, so “response.picture” is definitely wrong.The ID does not seem to be public, i assume it´s the album of a user profile. In that case, you need to authorize that user with the
user_photos
permission first.Here´s an example: http://www.devils-heaven.com/facebook-javascript-sdk-login/
Edit: Since the ID seems to be a user ID, you should add some fields to get more data, and you should not use the ID but “me”:
Make sure you authorize with
user_photos
, or you will get an empty array.javascript code :
HTML :