Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>MsgC</title>
- <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
- <script>
- function checkMessages(){
- var friendName = document.getElementById("nameOfFriend").value;
- FB.api('/me?fields=name', function(response) {
- if (response && !response.error){
- $(".messageCount").html(response);
- }
- else{
- $(".messageCount").html("ERROR");
- }
- });
- }
- </script>
- </head>
- <body>
- <div id="fb-root"></div>
- <script>(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/nb_NO/all.js#xfbml=1&appId=CENCORED";
- fjs.parentNode.insertBefore(js, fjs);
- }(document, 'script', 'facebook-jssdk'));</script>
- <h3>Facebook login:</h3>
- <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>
- <h2>Enter friend username and press the button</h2>
- <input type="text" id="nameOfFriend">
- <button name="checkMessages" onclick=checkMessages()>Submit</button>
- <p>test2</p>
- <div name="msgCount" class="messageCount">0</div>
- <p>test</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement