2

我想在我的 html 页面上将 facebook 请求对话框显示为 iframe。目前我有以下代码:

<div id="fb-root"></div>
    <script type="text/javascript">
    //<![CDATA[
           window.fbAsyncInit = function() {
               FB.init({appId: 'xyz', 
                  status: true, 
                  cookie: true, 
                  xfbml: true,
                  oauth: true});
            };


                FB.ui({ method: 'apprequests',
                    display: 'iframe',
                    title: 'Invitation to join game',
                    data: '1234',
                    new_style_message: true,
                    message: 'invitation to join game'});

            (function() {
                var e = document.createElement('script');
                e.type = 'text/javascript';
                e.src = document.location.protocol +
                    '//connect.facebook.net/en_US/all.js';
                e.async = true;
                document.getElementById('fb-root')
                                       .appendChild(e);
            }());
          //]]>
    </script>   

不应该 display:'iframe' 在页面加载时将该内容显示为 iframe?还是我在这里做错了什么?

我可以让它看起来像这样(我不想要): http: //forumbilder.se/images/b1620121110025243.jpg

这就是我希望它的样子: http: //forumbilder.se/images/3f62012111130ff92.jpg

4

0 回答 0