Kickapps: Determine if User is logged in on external page


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var url = "http://affiliate.kickapps.com/service/isUserLoggedIn.kickAction?callback=?"
  2. function checkLogin(data) {
  3.  
  4. if(data.isLoggedIn == "true") {
  5. // Hide Logged Out DIV
  6. document.getElementById('loggedOutMessage').style.display='none';
  7. // Show Logged In DIV
  8. document.getElementById('loggedInMessage').style.display='block';
  9. } else {
  10. // Show Logged Out DIV
  11. document.getElementById('loggedOutMessage').style.display='block';
  12. // Hide Logged In DIV
  13. document.getElementById('loggedInMessage').style.display='none';
  14.  
  15. }
  16. }
  17.  
  18. $.ajax({
  19. dataType: 'jsonp',
  20. data: {as: ######},
  21. jsonp: 'checkLogin',
  22. url: url,
  23. success: checkLogin
  24. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.