I’ve been reading several answers on this topic but I couldn’t make it work. This is what I am trying:
window.fbAsyncInit = function() {
FB.init({
appId : '247886858583094',
status : true,
cookie : true,
xfbml : true,
oauth : true,
});
FB.Event.subscribe('auth.login',function(response) { alert('You logged in'); } );
};
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
What do I add to get an alert on user login?
FB.Event.subscribe('auth.login',function(response) {alert('You logged in');
}
);
Add this code inside the scope of
window.fbAsyncInit = function()