I am a newbie in Facebook programming. This is how I put like buttons on a single page:
<html>
<head>
<script src="http://connect.facebook.net/en_US/all.js ></script>
</head>
<body>
<div>
<a href='@site1.Url'>@site1.Title</<a>
<fb:like href="site1.Url"></fb:like>
</div>
<div>
<a href='@site2.Url'>@site2.Title</<a>
<fb:like href="@site2.Url"></fb:like>
</div>
</body>
</html>
The like buttons appear and all looks good. But sometimes I can't actually like. Do you know what the probl开发者_运维知识库em is?
Try this instead:
<html>
<head>
</head>
<body>
<div>
<a href='@site1.Url'>@site1.Title</<a>
<fb:like href="@site1.Url"></fb:like>
</div>
<div>
<a href='@site2.Url'>@site2.Title</<a>
<fb:like href="@site2.Url"></fb:like>
</div>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
</body>
</html>
精彩评论