I have a website with facebook connect and a facebook page tab in witch the user must login to facebook.
I use the JS API and it open a popup to let the user connect.
It work fine everywhere but in ie 7 and 8.
instead of opening in a popup it open in a new tab. The user can log in but after it stay open and redirect to a blank page (https://www.facebook.com/dialog/permissions.request).
The login was successful and if the page is refreshed the user is logged in, but I need it be a popup and close itself after and do a callback so I can refresh the page like in other browser.
anyone have an idea on how to fix this, tried everything i could find and nothing work.
a part of my code : $`
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : '<cfoutput>#appId#</cfoutput>',
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // OAuth 2.0
status : true, // check login status
xfbml : true, // parse XFBML
channelUrl: 'http://192.168.1.96/gocoupons/OngletFacebook/channelUrl.cfm' //custom channel
});
};
(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));
/*(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());*/
function login() {
//$.cookie('fbsr_<cfoutput>#appId#</cfoutput>',null);
FB.login(function(response) {
if (response.authResponse) {
window.location.reload();
}
}, {scope: 'email,user_checkins'});
}
function addToPage() {
FB.ui({method: 'pagetab'}, function(response){
$('#pageid').val(JSON.stringify(response));
$('#formAjoutPage').submit();
});
}
</script>
`