My like button code goes as follows:
<div class="like-btn">
<fb:like href="http://www.example-url.com" layout="box_count" show_faces="true" width="450" action="like" colorscheme="light" ></fb:like>
</div>
My problem is that, I do not want the comment box to be displayed after clicking like. I'm using XFBML version of Like Button for tracking purpose, so comment box is inevitable.
I have multiple like buttons in the page with variable href's.
I have read all the questions/solutions regarding removing the comment box in this scenario, but none of them work. I'm hoping that Refreshing the contents of <div class="like-btn"> would help.
Could someone please help me figure out how I should tackle this problem?
Here is my attempt so far:
//copying content of the div since the href is retrieved via php and is variable
var content = $('.like-btn').html();
$('.like-btn').empty();
$('.like-btn').html(content);
UPDATE
The approach shown in the accepted answer works perfectly for the default like button (XFBML/HTML5) but not for the box-count styled.
With the way you are currently using it, try adding this to the page:
If that doesn't work, use the HTML5 Code for displaying the FB Like Button instead, something like this:
We set the height of
.fb-liketo25 pixelsandoverflow: hidden, which will prevent the comment box from popping up completely!You can see it working here: http://devs.dream-portal.net/dp11/index.php
UPDATED
For the box-count style, you can use the iframe version for the box-count and no comment box gets displayed (atleast not to me):
RE-UPDATED
You can also review the Top Answer on this stackoverflow question here with 114 up votes: Facebook Like Button - how to disable Comment pop up?
Try that and maybe it will work... not sure.