开发者

Why do facebook like buttons not work when there are multiple on the page?

开发者 https://www.devze.com 2023-03-18 09:47 出处:网络
I am trying to create a facebook like website here http://likes.vermilionsite.com/ but when you like a post they like for a fraction of a second and unlike again, could someone explain how to fix this

I am trying to create a facebook like website here http://likes.vermilionsite.com/ but when you like a post they like for a fraction of a second and unlike again, could someone explain how to fix this, is it because there is interference with the multiple buttons?

This is my source code:

开发者_如何学JAVA$sql_all = mysql_query("SELECT * FROM posts ORDER BY views DESC LIMIT 0,20")or die(mysql_error());
while($row_all = mysql_fetch_assoc($sql_all)){
$x++;
    echo "<div id=\"item".$x."\" class=\"item\">";
    echo $row_all['content']."<br><br>";
    echo "<div id=\"fb-root\"></div><script src=\"http://connect.facebook.net/en_US/all.js#appId=251780764837127&amp;xfbml=1\"></script><fb:like href=\"http://likes.vermilionsite.com/message.php?id=".$row_all['id']."\" send=\"false\" width=\"450\" show_faces=\"false\" font=\"\"></fb:like>";
    echo "<hr>";
    echo "</div>";
}


There is a tutorial on how to get multiple like buttons that link different things at : http://www.seriousreport.com/metatags_howtogetmultiplelikebuttons.php


<div id=\"fb-root\"></div>
<script src=\"http://connect.facebook.net/en_US/all.js#appId=251780764837127&amp;xfbml=1\"></script> 

this should only be once in your code, that could be the issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消