Friday, July 10, 2015

Latest ways Invite Friends on facebook using java script

Create facebook developer account & create an app in it.

Due to this you will get a API

    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'api key',
          xfbml      : true,
          version    : 'v2.2'
        });
      };
    //onclick="fbSendDialog()"
      (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/sdk.js";
         fjs.parentNode.insertBefore(js, fjs);
       }(document, 'script', 'facebook-jssdk'));
     
      function fbSendDialog(){
      FB.ui({
      method: 'send',
      name: 'application name',
      link: 'site url'
     });
       }
    </script>
<a href="#" onclick="fbSendDialog()" > Facebook</a>

No comments:

Post a Comment