Guest User

Untitled

a guest
Oct 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Login with XING plugin Example</title>
  5. <meta charset="UTF-8">
  6. <script>
  7. // This function is called by the plugin after
  8. // the login flow is completed.
  9. function onXingAuthLogin(response) {
  10. var output;
  11.  
  12. console.log(response);
  13.  
  14. if (response.user) {
  15. output = 'Successful login for ' + response.user.display_name;
  16. } else if (response.error) {
  17. output = 'Error: ' + response.error;
  18. }
  19. document.getElementById('output').innerHTML = output;
  20. }
  21. </script>
  22. </head>
  23. <body>
  24.  
  25. <!-- Place the plugin script -->
  26. <script type="xing/login">
  27. {
  28. "consumer_key": "__MY_CONSUMER_KEY__"
  29. }
  30. </script>
  31.  
  32. <p id="output">No user logged in.</p>
  33.  
  34. <!-- Include the plugin library -->
  35. <script>(function(d) {
  36. var js, id='lwx';
  37. if (d.getElementById(id)) return;
  38. js = d.createElement('script'); js.id = id; js.src = "https://www.xing-share.com/plugins/login.js";
  39. d.getElementsByTagName('head')[0].appendChild(js)
  40. }(document));
  41. </script>
  42.  
  43. </body>
  44. </html>
Add Comment
Please, Sign In to add comment