2013-04-10 4 views
-1

FB.login이 실패하고 FB.login에서 실행이 중지됩니다. 나는 단지 "로딩"이라고 말하는 몇 초 동안 페이스 북의 로그인 팝업을 볼 수있다. 그런 다음 사라지고 아무 일도 일어나지 않는다.FB.login에서 FB.login이 실패하고 실행이 중지됩니다.

나는 스크립트 태그에, body 태그의 모든 HTML 후

<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> 

후이 있습니다

$(".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'}); 
}); 

감사합니다!

답변

0

facebook-jssdkfb-root으로 바꿀 수 있습니다. 이것은 효과가있다. 샌드 박스 모드가 응용 프로그램 설정 페이지에서 사용할 수 없습니다

1

선택하면

+0

이 코멘트 (당신이 충분히 담당자 :-)있어 경우)로 더 적합 할 것 – GHC

관련 문제