Api FB.login失败,并在FB.login上停止执行

Api FB.login失败,并在FB.login上停止执行,api,facebook-javascript-sdk,Api,Facebook Javascript Sdk,FB.login失败,并在FB.login上停止执行。我只能看到几秒钟facebook登录弹出窗口,上面写着“加载”,然后它消失了,什么也没发生 我有后身标签 <div id="fb-root"></div> <script> window.fbAsyncInit = function() { // init the FB JS SDK FB.init({ appI

FB.login失败,并在FB.login上停止执行。我只能看到几秒钟facebook登录弹出窗口,上面写着“加载”,然后它消失了,什么也没发生

我有后身标签

<div id="fb-root"></div>
    <script>
        window.fbAsyncInit = function() {
            // init the FB JS SDK
            FB.init({
            appId      : '129519787234412', // App ID from the App Dashboard
            channelUrl : '<?=URL?>facebookChannel.php', // Channel File for x-domain communication
            status     : true, // check the login status upon init?

            xfbml      : true  // parse XFBML tags on this page?
            });

            // Additional initialization code such as adding Event Listeners goes here

        };

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


    </script>

谢谢

您可以尝试用
fb root
替换
facebook jssdk
。这应该会起作用。

检查应用程序设置页面上是否禁用了沙盒模式

这更适合作为注释(当您有足够的代表:-)时)
$(".box_top_img").click(function(){ 

    FB.login(function(response) {

        if (response.authResponse) {
            FB.getAuthResponse()['accessToken'];
            FB.api('/me', function(response) {

                $.ajax({
                    url:"ajax/check_vote.php",
                    type:"POST",
                    data:response,
                    success:function(response){
                        var result = $.parseJSON(response);

                        if(result.code == 0){
                            $("#container_1").hide();
                            $("#container_2").hide();
                            $("#container_3").show();

                        }else if(result.code == 1){
                            $("#container_1").hide();
                            $("#container_2").show();
                            $("#container_3").hide();

                            $("#facebook_id").val(result.id);

                            if(result.first_name)
                                $("#name").val(result.first_name);
                            if(result.last_name)
                                $("#lastname").val(result.last_name);
                            if(result.email)
                                $("#email").val(result.email);

                        }else{
                            $("#container_1").show();
                            $("#container_2").hide();
                            $("#container_3").hide();

                        }
                    }
                });
            });
        } else {
            console.log('User cancelled login or did not fully authorize.');
        }
    }, {scope: 'email'});
});