function statusChangeCallback(response) {// Called with the results from FB.getLoginStatus().console.log('statusChangeCallback');console.log(response);// The current login status of the person.if (response.status === 'connected') {// Logged into your webpage and Facebook.testAPI();} else {// Not logged into your webpage or we are unable to tell.document.getElementById('status').innerHTML = 'Please log ' +'into this webpage.';}}
function checkLoginState() {// Called when a person is finished with the Login Button.FB.getLoginStatus(function(response) {// See the onlogin handlerstatusChangeCallback(response);});}
window.fbAsyncInit = function() {FB.init({appId: '{670244055163982}',cookie: true,// Enable cookies to allow the server to access the session.xfbml: true,// Parse social plugins on this webpage.version: '{v18.0}'// Use this Graph API version for this call.});
FB.getLoginStatus(function(response) {// Called after the JS SDK has been initialized.statusChangeCallback(response);// Returns the login status.});};
function testAPI() {console.log('Welcome!Fetching your information.... ');FB.api('/me', function(response) {console.log('Successful login for: ' + response.name);document.getElementById('status').innerHTML ='Xin chào bạn, ' + response.name + '!';window.location.href = "https://hr-vjc.vn/de-tokutei-so-01/";}); }
