I have the following code (which is the initialization of the facebook API), I donβt understand why this snippet is triggered when loading without calling elsewhere in the code!
The funny thing is that when I fbAsyncInit function "wrapper", it works the same! so how is FB.init called without calling fbAsyncInit anywhere else?
window.fbAsyncInit = function() { FB.init({appId: '00000000000000000', status: true, cookie: true, xfbml: true}); FB.getLoginStatus(function(response) { if (response.session) { console.log('User is logged in.'); FB.api("/me?fields=name,picture", handleMe); } else { console.log('User is not logged in.'); window.location = "http://wall-et.com/index.php/test/login/"; } }); };
source share