2

我有一些适用于 Firefox 和其他浏览器的登录代码,但是当我在 Internet Explorer 中使用它时出现错误。帮我。

这是代码:http: //jsfiddle.net/6HXmS/1/

4

1 回答 1

0
  1. 确保您已添加所有必需的 og:meta 标签 https://developers.facebook.com/docs/opengraph/ 您也使用了 html5 版本的按钮,但您的文档未设置为 html5 文档类型,请更改文档类型或者,如果一切都失败了,您可以尝试按钮的 xfbml 版本。
  2. 尝试在 JS.sdk 加载后渲染按钮。

    <div id="fb-root"></div>
    <div id="loginbutton"></div>
    <script>
    window.fbAsyncInit = function() {
        FB.init({
            appId      : '136067339849637', // App ID
        channelUrl : '//www.crabiz.biz/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 loginbutton(){
    var loginb=document.getElementById('loginbutton');
    //loginb.innerHTML='';
    loginb.innerHTML=' <div class="fb-login-button" on-login="funx()" scope="email,user_likes,user_about_me,publish_stream,read_friendlists">
            Installa Artesposa
          </div><br>';
    FB.XFBML.parse(loginb);
    };
loginbutton();
    };
    (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));

    function funx() {    
        window.top.location.href = "https://www.facebook.com/Partecipazioninozze.Artesposa/app_136067339849637";    
        }
    function funxie() {    
        window.top.location.href = "https://apps.facebook.com/arte-sposa";    
        } 

    </script> 
于 2012-03-23T17:25:02.950 回答