Results 1 to 8 of 8

Thread: Share on Facebook

  1. #1
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Default Share on Facebook

    I have a website (static html) which has a title and article below (something like a news section) - i need to place the "Share on Facebook" below each article - when i click on it, the facebook popup should load that articles title and a snippet from that article. Currently i used the code below - it picks up the title and decription from the page and not from the article within the page. Please let me know how to customize it.

    <script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><a rel="nofollow" href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank">Share on Facebook</a>

    Thanks.
    (The client wants this section in static html and not in wordpress or joomla)

  2. #2
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    A link to the page would be nice.
    Jeremy | jfein.net

  3. #3
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

  4. #4
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Nothing shows in the text box when I attempt to share it on facebook,
    Jeremy | jfein.net

  5. #5
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Default

    Yep - i need to know how to add the title and the snippet from each article when the 'share on facebook' is clicked on the corresponding article.

    Thanks.

  6. #6
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Add to the end of the URL:
    Code:
    %title=BlahBlahBlah
    Jeremy | jfein.net

  7. #7
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Default

    I am not sure where to put the code (%title=BlahBlahBlah) - Can you please use it in this code - Thanks

    <script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><a rel="nofollow" href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank">Share on Facebook</a>

  8. #8
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Sorry - I was wrong. The text on facebook is the value of the meta discription:
    Code:
    <meta name="description" content="A Seal eats a Cow?">
    Last edited by Nile; 03-30-2010 at 07:45 PM.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •