douju1968 2013-06-21 12:21
浏览 67
已采纳

第三方facebook登录不在IE8中工作

I am using the following script for Facebook third party login:

<div id="fb-root"></div>
    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
     <script type="text/javascript">
       FB.init({
         appId  : '<?=$fbconfig['appid']?>',
         status : true, // check login status
         cookie : true, // enable cookies to allow the server to access the session
         xfbml  : true  // parse XFBML
       });

</script>

It's working for all browsers. but it not working in IE8. Kindly help me to solve that issue.

  • 写回答

1条回答 默认 最新

  • dreljie602951 2013-06-21 12:41
    关注

    I have used this asynchronous method many time, I think it may help someone

    <script>//initializing Facebook API
    window.fbAsyncInit = function() {
        FB.init({
             appId  : '<?=$fbconfig['appid']?>',
             status : true, // check login status
             cookie : true, // enable cookies to allow the server to access the session
             xfbml  : true  // parse XFBML
        });
    };
    (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><!-- login button --><a href="#" onclick="fblogin();return false;"><img src="images/my_login.png"></a><script>
    //your fb login function
    function fblogin() {
    FB.login(function(response) {
      // you script data
    }, {scope:'read_stream,publish_stream,offline_access'});
    }
    </script>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试