我有一个非常简单的用例。我有一个 facebook 用户 id 的 xhr 对象。 现在我只想通过以下方式显示用户的图像。
xhr.objects.forEach(function (user) {
$('#userimage').append( '< img src="https://graph.facebook.com/"+user.user_id+"/picture/?type=small"/>');
});
由于某种原因,这不起作用。图像未显示。我添加了“https://graph.facebook.com”以允许访问。来自本地网络服务器的图像也能正确显示。
最佳答案
你的字符串应该是这样的
picture?type=small
不是
picture/?type=small
所以正确的网址是:
"https://graph.facebook.com/"+user.user_id+"/picture?type=small"
参见how do I get a facebook users profile image through the fb api了解详情。
关于javascript - 在 PhoneGap 中显示 facebook 用户图像 (Android),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13699845/