本文介绍了FB._https = true与FB.Canvas.setAutoResize不兼容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



似乎当我将FB._https变量设置为true时, FB.Canvas.setAutoResize()停止调整iframe的大小。



这是我的代码如下:

  window.fbAsyncInit = function(){

FB._https = true; //麻烦制作者
FB.init({
appId:facebookAppId,
status:true,
cookie:true,
session:facebookSession,
xfbml: true
});

//该参数显示
//调整大小之间等待的毫秒数。
//显然,91是Paul最喜欢的数字。
// http://developers.facebook.com/docs/reference/javascript/FB.Canvas.setAutoResize/
FB.Canvas.setAutoResize(91);

};

任何想法?

解决方案

如果您设置 FB._https = true; ,并且您通过http访问该页面,那么您有困难。



我建议使用 FB._https =(window.location.protocol ==https:); per


I'm converting my facebook app to run through HTTPS.

It seems like when I set the FB._https variable to true, the FB.Canvas.setAutoResize() stops resizing the iframe.

This is what my code looks like:

    window.fbAsyncInit = function() {

    FB._https = true; // troublemaker
    FB.init({
        appId: facebookAppId,
        status: true,
        cookie: true,
        session: facebookSession,
        xfbml: true
    });

    // The parameter show how many milliseconds to wait between
    // resizing.
    // Apparently, 91 is Paul's favorite number.
    // http://developers.facebook.com/docs/reference/javascript/FB.Canvas.setAutoResize/
    FB.Canvas.setAutoResize(91);

};

Any ideas?

解决方案

If you set FB._https = true; and you access the page over http then you have trouble.

I suggest using FB._https = (window.location.protocol == "https:"); per Facebook JavaScript SDK over HTTPS loading non-secure items

这篇关于FB._https = true与FB.Canvas.setAutoResize不兼容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 02:01