首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我想要一个facebook分享按钮,分享用户的时间线上的特定数据?

我想要一个facebook分享按钮,分享用户的时间线上的特定数据?
EN

Stack Overflow用户
提问于 2014-01-02 16:40:37
回答 1查看 1.7K关注 0票数 0

我是facebook API的新手,但是我想在我的网站上有一个facebook分享按钮,可以在登录facebook后分享用户时间线上的特定数据。我已经阅读了一些文档,并在我的本地主机上制作了一个用于测试目的的页面。但是这个页面有一个问题,

代码语言:javascript
运行
复制
<!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.&nbsp;&nbsp;&nbsp;
   <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后,它显示一个空白页面。谁能帮帮我。谢谢

EN

回答 1

Stack Overflow用户

发布于 2014-01-02 16:53:39

你的网址//localhost/paramRND/FbShare.php它将不工作的it.add网址,这是活的。

或者,您可以使用localtunnel来访问您的本地计算机。您需要(临时)更改应用程序代码/ html中使用的一些URL,以便链接指向临时域名,但至少facebook可以连接到您的机器。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20879151

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档