我正在创建一个网络应用程序,类似于Facebook的类似框代码: http://developers.facebook.com/docs/reference/plugins/like-box/.

当用户将其粘贴到Web应用程序中时,他们应该能够获得类似的框,包括feed,如果他们选择了流,则可以在生成类似的框代码。

我已经使用以下代码来做到这一点;但是问题是我无法检索喜欢该页面的用户的图片。

如何检索他们的个人资料信息?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Facebook Feeds</title>

<script type="text/javascript">
function getPage()
{
    var getCont=document.getElementById("txarea").value;
    document.getElementById("getContent").innerHTML=getCont;
}
</script>
</head>

<body>

<input type="text" id="txarea" />
<input type="button" id="fbBtnClick" value="Click" onclick="getPage();"></input>
<div id="getContent">
</div>

</body>
</html>
有帮助吗?

解决方案

因此,我已经对此进行了测试,以下内容似乎是问题:

iframe的高度正在设置为 427px默认情况下 图片正在加载,但隐藏了,因为iframe的高度不够长

默认情况下,Facebook给出以下内容:

<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=true&amp;header=true&amp;高度= 427" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px;高度:427px;" allowTransparency="true"></iframe>

也改变了这一点:

<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=true&amp;header=true&amp;高度= 567" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px;身高:567px;" allowTransparency="true"></iframe>

将显示图片。因此,我认为您必须从用户那里获取输入,然后更改高度然后设置它。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top