Save More on Banking-Trading

window.fbAsyncInit = function() { // FB JavaScript SDK configuration and setup FB.init({ appId : '1712928178755073', // FB App ID status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse social plugins on this page version : 'v2.8' // use graph api version 2.8 }); // Check whether the user already logged in FB.getLoginStatus(function(response) { if (response.status === 'connected') { //display user data getFbUserData(); } }); }; // Load the JavaScript SDK asynchronously (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); // Facebook login with JavaScript SDK function fbLogin() { FB.login(function (response) { if (response.authResponse) { // Get and display the user profile data getFbUserData(); } else { document.getElementById('status').innerHTML = 'User cancelled login or did not fully authorize.'; } }, {scope: 'email'}); } // Fetch the user profile data from facebook function getFbUserData(){ return false; FB.api('/me', {locale: 'en_US', fields: 'id,first_name,last_name,email,link,gender,locale,picture'}, function (response) { $.ajax({ type : 'POST', url : 'https://www.checkoutsaver.com/fblogin', data : {fb_id: response.id,first_name:response.first_name,last_name:response.last_name,email:response.email}, async : false, success : function(response){ if(response == 1) { window.location.href = 'https://www.checkoutsaver.com/user/my-profile'; } if(response ==2) { // alert("You have already registered."); } } }); }); } // Logout from facebook function fbLogout() { FB.logout(function() { document.getElementById('fbLink').setAttribute("onclick","fbLogin()"); document.getElementById('fbLink').innerHTML = 'fb login'; document.getElementById('userData').innerHTML = ''; document.getElementById('status').innerHTML = 'You have successfully logged out.'; }); } /*==========FB Login=========*/ // function fbAsyncInit() { // FB.init({ // appId : '276125126250737', // status : true, // check login status // cookie : true, // enable cookies to allow the server to access the session // xfbml : true // parse XFBML // }); // } function facebookLogin() { FB.login( function(response) { if (response.status== 'connected') { FB.api('/me?fields=name,email', function(response) { console.log(response); // console.log('Good to see you, ' + response.email + '.'); $('.cs-loader').removeClass('hideloader'); response._token='4xBSCJMIWn4PxerMkphpAlCdmPKDn6NknL5dZiYg'; $.post( 'https://www.checkoutsaver.com/fblogin',response , function(response) { var redirect_url='https://www.checkoutsaver.com/user/my-profile'; $('.cs-loader').addClass('hideloader'); if (response==1) { window.location.href = redirect_url; }else if(response==11){ console.log("in"); if (window.matchMedia("(max-width: 767px)").matches) { var isMobileDevice='yes'; window.location.href = 'https://www.checkoutsaver.com/signup/confirmation2'; }else{ if(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())){ var isChromeBrowser='yes'; window.location.href = 'https://www.checkoutsaver.com/signup/chromeconfirmation3'; }else{ var isChromeBrowser='no'; window.location.href = 'https://www.checkoutsaver.com/signup/confirmation3'; } } }else if(response==0){ $("#login_error_msg").html('

Your Status is inactive.

'); $(window).scrollTop(0); }else if(response==2){ $("#login_error_msg").html('
Some error occured.
'); } else if(response==3){ $("#login_error_msg").html('
Your account is deleted.
'); }else{ $("#login_error_msg").html('
Facebook Email Required
'); } //window.location.href=response; //console.log("Response: "+response); }); /* $('#userInfo').html(response.name + ' ' + response.location.name); }); FB.api("/me/picture?width=200&redirect=0&type=normal&height=200", function (response) { if (response && !response.error) { console.log('PIC ::', response); }*/ }); } } ,{ scope: "email,public_profile,user_location" } ); } fbAsyncInit(); function fblogOut() { FB.logout(function(response) { console.log('logout :: ', response); }); } -->