我的应用程序显示了几个用户可以搜索的项目。我想为每个项目放置一个类似的按钮,这将使用PHP自动生成。在实现它之前,我正在尝试测试一些无效的东西。
<div class="fb-like" data-href="http://www.example.com/index.php?item=1" data-send="true" data-width="450" data-show-faces="true"></div>
当我把它放在页面上时,facebook like按钮没有出现,任何想法?
答案 0 :(得分:0)
好的,我已经设法解决了,
确保在声明<div class="fb-like" data-href="http://www.example.com/index.php?item=1" data-send="true" data-width="450" data-show-faces="true"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
</script>