我是facebook API的新手,但是我想在我的网站上有一个facebook分享按钮,可以在登录facebook后分享用户时间线上的特定数据。我已经阅读了一些文档,并在我的本地主机上制作了一个用于测试目的的页面。但是这个页面有一个问题,
<!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>Untitled Document</title>
</head>
<script>
function fbs_click(){
u=location.href;
t=document.title;
d='param kumar';
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'t='+encodeURIComponent(t)+'&d'+encodeURIComponent(d),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
</script>
<body>
<div>
<h2>Some content of my website pages..</h2>
</div>
<div id="fb">
If a tag can have multiple values, just put multiple versions of the same tag on your page. The first tag (from top to bottom) is given preference during conflicts.
<a href="http://www.facebook.com/share.php?u=http://localhost/paramRND/FbShare.php" onclick="return fbs_click()" target="_blank"> Share on FB</a>
</div>
</body>
</html>
但当我点击在Fb上分享按钮,在登录Facebook后,它显示一个空白页面。谁能帮帮我。谢谢
发布于 2014-01-02 08:53:39
你的网址//localhost/paramRND/FbShare.php
它将不工作的it.add网址,这是活的。
或者,您可以使用localtunnel来访问您的本地计算机。您需要(临时)更改应用程序代码/ html中使用的一些URL,以便链接指向临时域名,但至少facebook可以连接到您的机器。
https://stackoverflow.com/questions/20879151
复制