Saturday, 15 June 2013

javascript - during the FB.getLoginStatus(function(response) call, the response returned is null or has errors. Please let me know the possible reasons for this -



javascript - during the FB.getLoginStatus(function(response) call, the response returned is null or has errors. Please let me know the possible reasons for this -

during fb.getloginstatus(function(response) call, response returned null or has errors. please allow me know possible reasons this.. please find code below..

the alert alert('response not proper!! error occured!!'); shown..

<!-- add together javascript setup facebook js api --> <script type="text/javascript"> //init function window.fbasyncinit = function() { alert("hello!! calling init!!"); fb.init({ appid : 'myappid', // app id status : true, // check login status cookie : true, // enable cookies allow server access session xfbml : true // parse xfbml }); fb.api('/me', function(response) { if (!response || response.error) { alert('response not proper!! error occured!!'); } else { alert('your name ' + response.name); } }); fb.getloginstatus(function(response) { if (response.status === 'connected') { alert('hello!! connected!!'); // connected } else if (response.status === 'not_authorized') { alert('sorry!! have not authorized!!'); login(); // not_authorized } else { alert('sorry!! have not connected!!'); login(); // not_logged_in } }); }; // load sdk asynchronously (function(d){ alert("inside script adding func!!"); 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"; alert("after setting src!!"); ref.parentnode.insertbefore(js, ref); alert("end of script adding func!!"); }(document)); </script>

javascript facebook-javascript-sdk facebook-java-api

No comments:

Post a Comment