My code:
$(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.');
}
});
}
});
});
});
The Login dialog popups correctly, but after login it goes to a blank page 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
It does not close, i am working on a localhost and using Mozilla Firefox.
Things i noted:
- User is logged in.
- If popup closed then it
doescall back function