Facebook 多好友选择器在 RoR 应用程序中不起作用

发布于 2024-11-10 04:54:51 字数 967 浏览 2 评论 0原文

我尝试在 Ruby on Rails 应用程序中实现 Facebook 多好友选择器。 FB登录已经完成。我尝试将代码粘贴到我的视图中但似乎不起作用。

   <fb:serverFbml>
        <script type="text/fbml">
            <fb:fbml>
                <fb:request-form
                    method='POST'
                    type='an invitation to do this.'
                    content='I invite you to do this.  
                        <fb:req-choice url="http://apps.facebook.com/smiley/yes.php" label="Yes" />
                        <fb:req-choice url="http://apps.facebook.com/smiley/no.php" label="No" />'
                    <fb:multi-friend-selector actiontext="I invite you to do this.">
                </fb:request-form>
            </fb:fbml>
        </script>
    </fb:serverFbml>

我可以看到 Facebook 中的加载指示器,但它似乎永远存在。 我在这里缺少什么吗?请帮忙!

I tried to implement the Facebook multi friend selector in my Ruby on Rails application.
The FB login has already been done. I tried to paste this code into my view it but doesnt seem to be working.

   <fb:serverFbml>
        <script type="text/fbml">
            <fb:fbml>
                <fb:request-form
                    method='POST'
                    type='an invitation to do this.'
                    content='I invite you to do this.  
                        <fb:req-choice url="http://apps.facebook.com/smiley/yes.php" label="Yes" />
                        <fb:req-choice url="http://apps.facebook.com/smiley/no.php" label="No" />'
                    <fb:multi-friend-selector actiontext="I invite you to do this.">
                </fb:request-form>
            </fb:fbml>
        </script>
    </fb:serverFbml>

I can see the Loading indicator which comes in Facebook, but it seems to be there forever.
Is there anything I am missing here? Pls help!

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

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

发布评论

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

评论(1

殊姿 2024-11-17 04:54:51
 <div id="facebook_invites" class="conclusion" style="width: 750px; text-align: center">
    If you like <%= link_to "BillBaba.com", "/", :target => "_BLANK" %>, then please help us by spreading the word.<br/>
  <a id="wall_post" href="#" style="font-size: 2em;">Post on your Wall</a><br/>
  <a id="invite_friends" href="#" style="font-size: 1.5em;">Invite your Friends</a>
  </div>
    <div id="fb-root"></div>
  <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
    <script type="text/javascript">
      $('#wall_post').click(function() {
        FB.init({
          appId:'<%= @app_id %>', cookie:true,
          status:true, xfbml:true
        });

        FB.ui({ method: 'feed',
          link: 'http://www.billbaba.com',
          picture: 'http://www.billbaba.com/images/logo.gif',
          description: 'There is so much more to life, other than bill payments. Try BillBaba.com and never miss another bill payment.',
          name: 'BillBaba.com'});
      });

      $('#invite_friends').click(function() {
        FB.init({
          appId:'<%= @app_id %>', cookie:true,
          status:true, xfbml:true
        });

        FB.ui({ method: 'apprequests',
          message: 'There is so much more to life, other than bill payments. Try BillBaba.com and never miss another bill payment.'});
      });
    </script>

这里@app_id是从控制器传递的应用程序ID。

 <div id="facebook_invites" class="conclusion" style="width: 750px; text-align: center">
    If you like <%= link_to "BillBaba.com", "/", :target => "_BLANK" %>, then please help us by spreading the word.<br/>
  <a id="wall_post" href="#" style="font-size: 2em;">Post on your Wall</a><br/>
  <a id="invite_friends" href="#" style="font-size: 1.5em;">Invite your Friends</a>
  </div>
    <div id="fb-root"></div>
  <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
    <script type="text/javascript">
      $('#wall_post').click(function() {
        FB.init({
          appId:'<%= @app_id %>', cookie:true,
          status:true, xfbml:true
        });

        FB.ui({ method: 'feed',
          link: 'http://www.billbaba.com',
          picture: 'http://www.billbaba.com/images/logo.gif',
          description: 'There is so much more to life, other than bill payments. Try BillBaba.com and never miss another bill payment.',
          name: 'BillBaba.com'});
      });

      $('#invite_friends').click(function() {
        FB.init({
          appId:'<%= @app_id %>', cookie:true,
          status:true, xfbml:true
        });

        FB.ui({ method: 'apprequests',
          message: 'There is so much more to life, other than bill payments. Try BillBaba.com and never miss another bill payment.'});
      });
    </script>

Here @app_id is the application id being passed from the controller.

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