Facebook login dialog doesn't close using javascript SDK -
i've tried facebook login using fb javascript sdk.
after login doesn't close login window in opera browser. how can fix problem?
i've tried following source code: (on-line in this website - link)
<html> <head></head> <body> <div id="fb-root"></div> <script> window.fbasyncinit = function() { fb.init({ appid: '101103500012652', // app id channelurl: '//www.milujse.cz/app/channel.html', // channel file status: true, cookie: true, xfbml: true }); fb.event.subscribe('auth.authresponsechange', function(response) { if (response.status === 'connected') { testapi(); } else if (response.status === 'not_authorized') { } else { } }); }; (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 testapi() { fb.api('/me', function(response) { alert('good see you, ' + response.name + '.'); }); } function loginfb() { fb.login(function(response) { if (response.authresponse) { testapi(); } else { } }); } function logoutfb() { fb.logout(function(response) { }); } </script> <input type="button" value="login" onclick="loginfb(); return false;" /> <input type="button" value="logout" onclick="logoutfb(); return false;" /> </body> </html>
have considered checking browser , if it's opera using other way connect facebook, mean oauth can redirect whole page facebook login page instead of using popup , wont have problem of not being able close popup. link whole page si "https://graph.facebook.com/oauth/authorize?client_id=your_client_id&redirect_uri=http:your_callback-url&scope=what_you_want"
Comments
Post a Comment