Advertisement
Guest User

MsgC

a guest
Mar 19th, 2014
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.22 KB | None | 0 0
  1. <html>
  2.   <head>
  3.     <title>MsgC</title>
  4.     <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  5.     <script>
  6.     function checkMessages(){
  7.         var friendName = document.getElementById("nameOfFriend").value;
  8.         FB.api('/me?fields=name', function(response) {
  9.             if (response && !response.error){
  10.                 $(".messageCount").html(response);
  11.             }
  12.             else{
  13.                 $(".messageCount").html("ERROR");
  14.             }
  15.         });
  16.     }
  17.     </script>
  18.   </head>
  19.   <body>
  20.     <div id="fb-root"></div>
  21.     <script>(function(d, s, id) {
  22.     var js, fjs = d.getElementsByTagName(s)[0];
  23.     if (d.getElementById(id)) return;
  24.     js = d.createElement(s); js.id = id;
  25.     js.src = "//connect.facebook.net/nb_NO/all.js#xfbml=1&appId=CENCORED";
  26.     fjs.parentNode.insertBefore(js, fjs);
  27.     }(document, 'script', 'facebook-jssdk'));</script>
  28.  
  29.   <h3>Facebook login:</h3>
  30.   <div class="fb-login-button" data-max-rows="1" data-size="medium" data-show-faces="false" data-auto-logout-link="true" scope="basic_info"></div>
  31.  
  32.   <h2>Enter friend username and press the button</h2>
  33.   <input type="text" id="nameOfFriend">
  34.   <button name="checkMessages" onclick=checkMessages()>Submit</button>
  35.   <p>test2</p>
  36.   <div name="msgCount" class="messageCount">0</div>
  37.   <p>test</p>
  38.   </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement