We are getting a permission denied error in IE8. f

2019-07-31 01:32发布

We are getting a permission denied error in IE8. It happens after the FB.init. We have tried the channelUrl fix. We have put the as the first tag after the body. We have tried the document.domain in both the script and in the channel.html. We have tried the FB.UIServer.setActiveNode workaround. It works fine in IE9, FF, Chrome and Safari.

<div id="fb-root"></div>
  <script src="//connect.facebook.net/en_US/all.js"></script>
  <script type="text/javascript">
          var myUserId;
          document.domain = 'XXXX.XXXX.com';

          window.fbAsyncInit = function() {
              FB.init({ appId: 'XXXXXXXXX',
                  status: true,`enter code here`
                  cookie: true,
                  xfbml: true,
                  channelUrl: 'http://XXX.XXXX.com/channel.html'
              });
              FB.UIServer.setActiveNode = function(a, b) { FB.UIServer._active[a.id] = b; } // IE hack to correct FB bug

I am getting an permission denied error in IE8 in a facebook-iframe for a tab app on a facebook-fanpage. Any ideas how to fix this?

3条回答
姐就是有狂的资本
2楼-- · 2019-07-31 02:05

This worked for me:

FB.init({
    appId:        'xxxxx',
    appSecret:    'xxxxxxxxx',
    status:        true
    cookie:        true
});

// this code solves the issue
  FB.UIServer.setLoadedNode = function (a, b) { 
  FB.UIServer._loadedNodes[a.id] = b; 
};

As seen here http://ikorolchuk.blogspot.com/2011/09/facebook-javascript-sdk-security-error.html?showComment=1323866805727#c7681567069563597438

查看更多
神经病院院长
3楼-- · 2019-07-31 02:09

It is possibly because you redirect to a HTTP page while your current iframe is https.

The protocol of the iframe can be https, maybe because of an internal redirect, even if the Facebook page is http.

查看更多
在下西门庆
4楼-- · 2019-07-31 02:14

I'd suggest attaching the debugger and posting exactly where the error occurs. If its related the Facebook Proxy it might be a temporary issue with Facebook.

A couple of suggestions ( not mentioned above ):

1/ Try adding FBML to your html tag:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en">

2/ Try disabling compatibility mode options if your are accessing a test server that might be considered an intranet site ( generally same subnet ).

查看更多
登录 后发表回答