0

I am not able to use Facebook Like and Share Butoon on my website
Anyone can help mee

<html>

<head>
</head>

<body>
<div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'app id',
          status     : true,
          xfbml      : true
        });
      };

      (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/all.js";
         fjs.parentNode.insertBefore(js, fjs);
       }(document, 'script', 'facebook-jssdk'));
    </script>
<div class="fb-share-button" data-href="http://gmail.com" data-width="100" data-type="button_count">

</div>
</body>

</html>
2
Contributors
3
Replies
13
Views
3 Years
Discussion Span
Last Post by gsynr
0

hi use your code and just put my app id fb. so it is sharing. i don't know what you want or may be fb app id you are putting is wrong.

0

`
i put both like and share in one html. put my app id it working. may help u.

<html>

<head>
</head>

<body>
<div id="fb-root"></div>

    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'put your fb aap id here create it from fb',
          status     : true,
          xfbml      : true
        });
      };

      (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/all.js";
         fjs.parentNode.insertBefore(js, fjs);
       }(document, 'script', 'facebook-jssdk'));
    </script>
<div class="fb-share-button" data-href="http://google.com" data-width="100" data-type="button_count"></div>

<div class="fb-like" data-href="http://www.google.com" data-send="false" data-layout="button_count" data-width="60" data-show-faces="true"></div>

</body>
</html>
<script type="text/javascript">
var sUrl = window.location;
document.getElementById('fb').setAttribute('href', sUrl);
</script>

`

Edited by mangel.murti: code modify

0

i used like and share button both
with the same code
and share button is working fine
but when i use the like button
then it given** Error** and like button no loads again on the page..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.