2013-03-15 3 views
0

PhoneGap 및 Facebook Javascript SDK로 안드로이드 개발을 배우고 있습니다. 내 응용 프로그램을 시작할 때마다 계속이 오류가 발생하며 정확히 무엇이 잘못되었는지 알지 못합니다. 저 좀 도와 주 시겠어요?오류가 발생했습니다. 잠시 후 다시 시도하십시오

여기에는 다음과 같은 세부 사항은 다음과 같습니다

프로젝트 위치 : D : \ 안드로이드 꿈 \ FacebookExercise \ 자산 \ www가 \

로컬 호스트 위치 index.html을 : C : \ 프로그램 파일 \ Apache Software Foundation \ Tomcat 7.0 \ webapps \ ROOT \

내 APP_ID가 올바르게 설정되어 있습니다. 이 내 FB의 일부 설정은 다음과 같습니다 페이스 북 로그인

Site URL: http://localhost:8080/ 

모바일 웹과

웹 사이트

Mobile Site URL: http://localhost:8080/ 

index.html을

<html> 
<header> 
    <title>Kissa Android App</title> 
    <script type="text/javascript" charset="utf-8" src="cordova-2.5.0.js"></script> 
    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> 
</header> 
<body> 
    <div id="fb-root"></div> 
    <div id="user-info"></div> 
    <script type="text/javascript"> 
     var isLoaded = false; 
     // Additional JS functions here 
     window.fbAsyncInit = function() { 
      FB.init({ 
       appId  : 'The App ID', // App ID 
       channelUrl : 'http://localhost:8080/res/channel.html', // Channel File 
       //channelUrl : 'http://10.0.2.2:8080/assets/www/channel.html', 
       status  : true, // check login status 
       cookie  : true, // enable cookies to allow the server to access the session 
       xfbml  : true, // parse XFBML 
       oauth  : true 
      }); 

      isLoaded = true; 

      FB.getLoginStatus(function(response) { 
       if (response.status === 'connected') { 
        //window.location = "http://www.google.com"; 
       } else if (response.status === 'not_authorized') { 
        // not_authorized 
        //alert("You are unauthorized to access this page."); 
       } else { 
        //document.getElementById('name').innerHTML = ''; 
       } 
      }); 



      FB.login(function(response) { 
       if (response.authResponse) { 
        FB.api('/me', function(response) { 
         document.getElementById('name').innerHTML = 'Name : ' + response.first_name; 
         var fbLoginBtn = document.getElementById('fbLoginBtn'); 
         fbLoginBtn.innerHTML = '<fb:login-button autologoutlink="true" perms="email">&nbsp;</fb:login-button>'; 
         FB.XFBML.parse(fbLoginBtn); 
        }); 
       } else { 
        // cancelled 
       } 
      }); 

      FB.Event.subscribe("auth.logout", function() {window.location = 'index.html'}); 
     }; 

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

    <script type="text/javascript"> 
     function isLoaded(){ 
      alert("heuy!"); 
      if(isLoaded) 
       alert(isLoaded); 
      else 
       alert(isLoaded); 
     } 
    </script> 

    <fb:login-button autologoutlink="true" perms="email">&nbsp;</fb:login-button> 
    <div id="fbLoginBtn"> 
     <fb:login-button autologoutlink="true" perms="email">&nbsp;</fb:login-button> 
    </div> 
    <div id="name" style="font-family : arial"></div> 
    <div id="email"></div> 

    <input type="button" onclick="isLoaded()" value="hey"/> 

</body> 

답변

관련 문제