www.webdeveloper.com
Results 1 to 2 of 2

Thread: Problem with sharing a link on facebook

  1. #1
    Join Date
    Mar 2011
    Posts
    7

    Red face Problem with sharing a link on facebook

    Im using facebooks code to allow users to share a link on their profile. the facebook code is

    <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" class="fb_share_link">Share on Facebook</a>



    The problem is, im using PHP mod_rewrite, so my url looks like mydomain/products/product_name
    i.e it looks like a folder rather than a page and when i click on the Share With Facebook link, the facebook page opens but the link is not captured. If i change it to mydomain/product/product_name.php, it will work....

  2. #2
    Join Date
    Feb 2011
    Location
    israel
    Posts
    157
    try
    Code:
    function fbs_click() 
    {
    
    u=location.href;
    t=document.title;
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'.php'+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width= 626,height=436');
    return false;
    }
    this adds the .php extension....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles