创建带有链接的 Facebook 对话框弹出窗口

发布于 2024-10-07 10:12:04 字数 312 浏览 1 评论 0原文

我正在尝试使用上周发布的新改进来创建 Facebook 对话框。

http://developers.facebook.com/blog/post/437

我想要的是能够有一个链接,这样当点击它时就会生成一个弹出窗口,或者让它显示在页面中。我尝试将它放在 DIV 中,然后用 JQuery 显示,但它不会在页面上居中。我已经获得了用于发布到用户墙的代码...只是不知道如何格式化 JS 代码和/或创建弹出窗口的链接。 提前致谢!

I am trying to create a Facebook Dialog using the new improvements that were released last week.

http://developers.facebook.com/blog/post/437

What I want is to be able to have a link so when it's clicked a popup is generated, or have it show up in the page. I've tried putting it in a DIV and then showing with JQuery but it won't center on the page. I've gotten the code to work for posting to the users wall... just don't know how to either format the JS code and or create the link for the popup.
Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

望笑 2024-10-14 10:12:04

只要您的页面上有 Facebook js,创建好友邀请就这么简单:

<script>
    FB.ui(
     { 
      method: 'friends.add', 
      id: fbid // assuming you set this variable previously...
     }, 
     function(param){

      // If you have FireFox + FireBug or Chrome + developer tools:
      console.log(param); // log response to javascript console

            // If they cancel params will show: 
            //    {action:false, ...}
            // and if they send the friend request it'll have:
            //    {action:true, ...}
            // and if they closed the pop-up window then:
            //    param is undefined
     }
    );
</script>

您可以使用 Facebook 上的 javascript 控制台应用程序来测试这一点:

http://developers.facebook.com/tools/console

粘贴上面的脚本,包括标签,或单击底部的“示例”按钮文本区域并找到“fb.ui —friends.add”示例。

As long as you have the Facebook js on your page, it's as easy as this to create a friend invitation:

<script>
    FB.ui(
     { 
      method: 'friends.add', 
      id: fbid // assuming you set this variable previously...
     }, 
     function(param){

      // If you have FireFox + FireBug or Chrome + developer tools:
      console.log(param); // log response to javascript console

            // If they cancel params will show: 
            //    {action:false, ...}
            // and if they send the friend request it'll have:
            //    {action:true, ...}
            // and if they closed the pop-up window then:
            //    param is undefined
     }
    );
</script>

You can test this by using the javascript console app on Facebook:

http://developers.facebook.com/tools/console

Paste in the script above, including the tags, or click the "Examples" button on the bottom of the text area and find the "fb.ui — friends.add" example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文