Facebook JS SDK - login popup does not close

The event of entering the div is attached below. If I click on it, I will get the expected js sdk popup. However, after sending a pop-up window with my credentials, the pop-up window turns white and does not close. If I refresh the page, I am logged in, but it does not refresh automatically, as you might expect. Does anyone have any ideas?


Edit: The same code (with id and domain credentials) runs on a different server. This makes me think that my problem may not be related to the code below. Are there any application or server configurations that could cause the login popup to not be able to close / update?


<!DOCTYPE html>
<html class="no-js ie ie10plus" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml">
    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object#">
        <script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.0.6-development-only.js"></script>
    </head>
    <body>
        <div id="fb-root"></div>
        <div id="fbLogin">Test login link</div>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" ></script> 
        <script>               
              var fbmm = {};

              window.fbAsyncInit = function() {
                FB.init({
                  appId      : '339910146083688', // App ID
                  cookie: true, 
                  xfbml: true,
                  status: true,
                  oauth: true
                });

                $(document).ready(function(){
                    $("#fbLogin").click(function(){
                        console.log('test');
                         FB.login(function(response) {
                           if (response.authResponse) {
                             console.log('Welcome!  Fetching your information.... ');
                             FB.api('/me', function(response) {
                               console.log('Good to see you, ' + response.name + '.');
                             });
                           } else {
                             console.log('User cancelled login or did not fully authorize.');
                           }
                         });
                    });
                });

              };

          (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>
    </body>
</html>
+5
5

, 80 443. ( "" ) HTTP (S) , .

+5

, , URL- , ( Channel Url)

.
...
channelUrl , .

, , , , , , , , 100% .
, , javascript:

FB.init({
    appId: '339910146083688', // App ID
    cookie: true, 
    xfbml: true,
    status: true,
    oauth: true,
    channelUrl: YOUR_CHANNEL_URL
});
0

auth . , facebook app-auth, / . > Auth Dialog. . " " . . enter image description here

0

I had the same problem when the development site address was http://localhostI determined the host in the Windows hosts file and it worked fine.

0
source

I received a similar call FB.login()to close the dialog by changing

onclick="loginviafb()";

to

onclick="loginviafb(); return false;"
0
source

All Articles