登录Javascript后Facebook空白页

时间:2015-02-19 16:24:58

标签: javascript jquery facebook facebook-graph-api

我的代码:

$(document).ready(function() {
                $.ajaxSetup({ cache: true });
                    $.getScript('https://connect.facebook.net/en_UK/all.js', function() {

                        FB.init({ appId: 'xxxxxxxxxxx', status: true, cookie: true, xfbml: true});
                        FB.getLoginStatus(function (response){
                            if(response.status==='connected')
                            {
                                load(response);
                            }
                            else
                            {
                                FB.login(function(response) {
                                    if (response.authResponse) {
                                      $(".load").html('Welcome!  Fetching your information.... ');
                                      FB.api('/me', function(response) {
                                        $(".load").html('Good to see you, ' + response.name + '.');
                                        load(response);
                                      });
                                    } else {
                                      $(".load").html('User cancelled login or did not fully authorize.');
                                    }
                                });
                            }
                        });

                });    
            });

“登录”对话框正确弹出,但登录后会转到空白页面https://www.facebook.com/v2.2/dialog/oauth?redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2FDU1Ia251o0y.js%3Fversion%3D41%23cb%3Df246e4d89fef184%26domain%3Dlocalhost%26origin%3Dhttp%253A%252F%252Flocalhost%252Ffeb48fe70fe9c%26relation%3Dopener%26frame%3Df1092c4e4c168ce&display=popup&response_type=token%2Csigned_request&domain=localhost&client_id=xxxxxxxxxxx&ret=login&sdk=joey&ext=1424366134&hash=AeaJ_v2XTa9paggktPU

它没有关闭,我正在使用本地主机并使用Mozilla Firefox。

我注意到的事情:

  1. 用户已登录。
  2. 如果弹出窗口关闭,则does回调功能

1 个答案:

答案 0 :(得分:0)

清除浏览器的缓存和Cookie后,它已成功运行。

相关问题