【问题标题】:fb_xdm_frame_https permission denied with AJAX使用 AJAX 拒绝 fb_xdm_frame_https 权限
【发布时间】:2012-04-26 09:44:33
【问题描述】:

我正在像这样加载 api:

<div id="fb-root"></div> 
<script> 
    window.fbAsyncInit = function() { 
        FB.init({ 
        appId      : 'YOUR_APP_ID', // App ID 
        channelURL : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File 
        status     : true, // check login status 
        cookie     : true, // enable cookies to allow the server to access the session 
        oauth      : true, // enable OAuth 2.0 
        xfbml      : true  // parse XFBML 
        }); 
    }; 

    (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/el_GR/all.js"; 
    d.getElementsByTagName('head')[0].appendChild(js); 
    }(document)); 
</script>

我正在通过 jQuery UI 对话框打开一个页面并使用以下内容重新解析#cmets 部分:

<script>FB.XFBML.parse(document.getElementById('comments'));</script>

虽然在非 ajax 加载的页面上工作正常,但当我从对话框中打开它时,它会给出错误(在 js 控制台上):

Permission denied to access property 'fb_xdm_frame_https' @ https://s-static.ak.fbcdn.net/rsrc.php/v1/yt/r/Via9RsGlPnX.js:66

它看起来好像还在加载(gif 一直在播放)

有什么想法吗?

【问题讨论】:

  • 你有一个可以看到发生这种情况的网址吗?
  • 肖恩,不,我放弃了这个想法并实现了我的自定义 cmets。仅供参考,当您单击 menufesto.gr/goodys 打开对话框的其中一种食物时会发生这种情况。

标签: facebook-graph-api jquery facebook-comments


【解决方案1】:

我认为您没有正确加载 javascript sdk。试试这个代码

window.fbAsyncInit = function() {
     FB.init({
          appId      : 'appid', // App ID
          channelUrl : 'http://www.url.com', // Channel File
          status     : true, // check login status
          cookie     : true, // enable cookies to allow the server to access the session
          xfbml      : true  // parse XFBML
     });
};

 (function(d){
      var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement('script'); js.id = id; js.async = true;
      js.src = "//connect.facebook.net/en_US/all.js";
      ref.parentNode.insertBefore(js, ref);
 }(document));

【讨论】:

    猜你喜欢
    • 2011-06-13
    • 1970-01-01
    • 2015-04-03
    • 2020-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-14
    • 1970-01-01
    相关资源
    最近更新 更多