1

I have a YouTube video on my website and want to add Share button then users can share that video on Facebook. (Only video and not the whole site)

Here is my code, which doesn't seem to work:

<a name="fb_share" type="box_count" href="http://www.youtube.com/watch?v=5Fgsi9nw_ME" rel="nofollow" alt="Share">Share</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> 

Any idea? Or any other method to add this button on the website?

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
Dan
  • 21
  • 2
  • 3

3 Answers3

0

Have you followed the instructions at the Facebook API page? Just follow the instructions there and you get nice clean code, which can be used to share the video URL and much more.

EDIT: Updated with send button, not like button

sdamashek
  • 636
  • 1
  • 4
  • 13
  • The link you provided is for like button, and not share button. It seems they dont support share button anymore. – Dan Mar 05 '13 at 19:07
  • I changed the link to the Send button, which is what you're thinking of. – sdamashek Mar 05 '13 at 19:09
0

Please refer in this .

First refer that link and its give copy then past some code.

  • Thank you for your reply. I only found like button on this link. Which is difference than share button. – Dan Mar 05 '13 at 19:12
  • Ya. Please refer full in this(Send button is Same us share button ) https://developers.facebook.com/docs/reference/plugins/like/ –  Mar 05 '13 at 19:34
0

Create a button for you fb share e.g

 $('ID OF YOUR BUTTON').click(function(e){
                e.preventDefault();
                FB.ui({
                    method: 'feed',
                    name: 'NAME OF YOUR VIDEO',
                    link: 'LINK OF YOUR VIDEO FROM YOUTUBE',
                    caption: 'YOUR CAPTION',
                    description: 'YOUR DESCRIPTION',
                });
            });
Lian
  • 1,597
  • 3
  • 17
  • 30