Home ยป Technology | Useful tips

Facebook like-box shows user's facebook home page instead of like-box content

  1. Jun 2010 by Soan

Recently, I was implementing the Facebook Social plug-ins and encountered this strange error.

The situation is like this:

I already had the facebook fan box (Now renamed as facebook like-box) on my site and was working perfectly fine.

I just wanted to add the facebook like button (Which allows visitors to click it to mark their liking) on site. For this, I obtained the respective button code and ran my site.

And the result was fine if i was not currently logged in to my facebook account. The "like button" showed up correctly along with the facebook fan box (Like box).

But when I logged in to my facebook account and visited my website, the result was really unexpected. Here is the screen shot of the error.

Errors:

  1. When I click the like-button, it throws an error saying that NO-URL was specified even though I used the XFBML tag and implemented the facebook javascript SDK.

  2. The facebook fan box(like box) shows the my facebook home page. This is really weird as it should show the fan list instead of my facebook home page on this site.



Facebook like button URL Error

I even visited a couple of other sites who have implemented facebook fan box earlier and they also showed the same error.

Solution to facebook like-button and like-box error:



After a long session of hit and trial, I finally managed to find a solution:

  1. The facebook javascript is off-course essential to use the new like button and like box in an effective manner. You can find the javascript library code here. This remains unchanged.

  2. The facebook like button code also remains.

  3. The old code of facebook like box :


    would not work with the new facebook like button and the javascript SDK. This seems to be the issue.

    I just changed the above code also with the new one and both controls (like button and like box) started behaving as desired. Here is the new code:

    facebook like box new code

    I hope it will help you in case you also faced the same issue.


This is a QR code for this article. It contains the link for this article and can be scanned through a QR code reader application in your mobile to quickly open it in any mobile browser.

Would you like to share this article?


For more helpful articles like this, subscribe to our free newsletter or stay connected on social networks:

SUBSCRIBE
Subscribe to AM22 tech in Reader or by Email
Sign up for our updates in Email (Free):

 

Have questions? Write into comments or ask in forum