Facebook iframe应用程序中的滚动条。。。再一次

Facebook iframe应用程序中的滚动条。。。再一次,facebook,iframe,facebook-iframe,Facebook,Iframe,Facebook Iframe,我会用两种不同的结果做同样的事情两次 我在这里开了一家店,效果很好 应用程序链接: 以及松开滚动条的代码: <div id="fb-root"></div> <script src="https://connect.facebook.net/en_US/all.js"></script> <script> window.fbAsyncInit = function() { FB.init({

我会用两种不同的结果做同样的事情两次
我在这里开了一家店,效果很好
应用程序链接:

以及松开滚动条的代码:

     <div id="fb-root"></div>
    <script src="https://connect.facebook.net/en_US/all.js"></script>
    <script>
  window.fbAsyncInit = function() {
    FB.init({
      appId : '365351356xxxxxx', //Your facebook APP here
      cookie : true // enable cookies to allow the server to access the session
    });
  }

  window.onload = function() {
    FB.Canvas.setAutoGrow(91);
  }
</script>

window.fbAsyninit=函数(){
FB.init({
appId:'365351356xxxxxx',//此处是您的facebook应用程序
cookie:true//启用cookie以允许服务器访问会话
});
}
window.onload=函数(){
FB.Canvas.setAutoGrow(91);
}
在这里尝试了相同的代码之后,我有了滚动条

链接到FB中的应用程序:

下面是我用来尝试自动调整大小的代码(不太管用):

    <div id="fb-root"></div>
<script type="text/javascript">
  window.fbAsyncInit = function() {
    FB.init({
    appId      : '420678397xxxxxx', // App ID
      channelUrl : '//www.publicityresultshosting.com//channel.html', // Channel File
  status     : true, // check login status
  cookie     : true, // enable cookies to allow the server to access the session
  xfbml      : true  // parse XFBML
    });

  };

 // Load the SDK Asynchronously
  (function(d){
 var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
 js = d.createElement('script'); js.id = id; js.async = true;
 js.src = "//connect.facebook.net/en_US/all.js";
 d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
</script>


<script type="text/javascript">
    window.fbAsyncInit = function() {
        FB.init({appId: '420678397xxxxxx', status: true, cookie: true, xfbml: true});
        FB_RequireFeatures(["CanvasUtil"], function(){ FB.XdComm.Server.init("xd_receiver.htm");
            FB.CanvasClient.startTimerToSizeToContent(); });
           FB.Canvas.setAutoResize(true,500);
    };
    (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
            '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
    }());
   </script>

window.fbAsyninit=函数(){
FB.init({
appId:'420678397xxxxxx',//应用程序ID
channelUrl:'//www.publicityresultshosting.com//channel.html',//频道文件
状态:true,//检查登录状态
cookie:true,//启用cookie以允许服务器访问会话
xfbml:true//解析xfbml
});
};
//异步加载SDK
(职能(d){
var js,id='facebook jssdk';if(d.getElementById(id)){return;}
js=d.createElement('script');js.id=id;js.async=true;
js.src=“//connect.facebook.net/en_US/all.js”;
d、 getElementsByTagName('head')[0].appendChild(js);
}(文件);
window.fbAsyninit=函数(){
init({appId:'420678397xxxxxx',状态:true,cookie:true,xfbml:true});
FB_RequireFeatures([“CanvasUtil”],function(){FB.XdComm.Server.init(“xd_receiver.htm”);
FB.CanvasClient.startTimerToSizeToContent();});
FB.Canvas.setAutoResize(true,500);
};
(功能(){
var e=document.createElement('script');e.async=true;
e、 src=document.location.protocol+
“//connect.facebook.net/en_US/all.js”;
document.getElementById('fb-root').appendChild(e);
}());

关于如何解决这个问题有什么想法吗?

您必须设置大小,页面加载后,您可以在回调中运行
setAutoGrow()

FB.Canvas.setSize({ width: 810, height: 950 });

FB.Canvas.setDoneLoading( function(response) {
    FB.Canvas.setAutoGrow();
});
rtfm?(setAutoResize已弃用,不再使用)