2012-06-27 190 views
0

我想在我的web應用程序中實現Facebook登錄。我得到了應用程序ID和我的代碼是follows.` 我的Facebook登錄頁面 Facebook登錄在網絡應用程序

<div id="fb-root"></div> 
    <script> 
    window.fbAsyncInit = function() { 
     FB.init({ 
     appId  : '<<App Id>> ', // App ID 
     channelUrl : '//www. DOMAIN NAME.com/channel.html', // Channel File 
     status  : true, // check login status 
     cookie  : true, // enable cookies to allow the server to access the session 
     xfbml  : true // parse XFBML 
     }); 
     // Additional initialization code here 
    }; 
    // 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><div class="fb-login-button"><a href=" ">Login with Facebook</a></div> 
</body> 

`。我正在嘗試運行此應用程序併爲其提供錯誤。我也得到了密鑰,但不知道在哪裏放置它。我們是否需要爲此放置任何css或js或任何其他文件?

任何幫助是極大的讚賞..

+1

,請列明錯誤! –

+0

它說..「發生錯誤」稍後再試 – user1277996

回答

0
appId  : '<<App Id>> ', //Place App ID 
channelUrl : '//www. DOMAIN0 NAME.com/channel.html', // Place domain here 
相關問題