Facebook Like 按钮进入 prestashop
我正在为 Prestashop 创建一个模块,在产品下显示 facebook 的 Like 按钮(以及 Twitter 的 Tweet it),但是 Facebook 按钮仍然没有加载...
我在页面中添加了以下代码,有什么问题吗?
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '118323178240875', status: true, cookie: false, xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<fb:like show_faces="false" width="450" action="recommend" font="verdana"></fb:like>
I'm creating a module for Prestashop, that display facebook's Like button (and Twitter's Tweet it) under product, but the Facebook button is still not loading...
I get the following code into the page, is there something wrong?
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '118323178240875', status: true, cookie: false, xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<fb:like show_faces="false" width="450" action="recommend" font="verdana"></fb:like>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了我的问题。
问题是我在页面中初始化了 XFBML 两次,这导致了问题...
我创建了专门用于 XFBML 初始化的特殊模块以及用于显示 Like 按钮和 Fan 框的其他模块
I already solved my issue.
The problem was that I initialized XFBML twice in my page which cause problems...
I created special module just for XFBML initialization and other modules for displaying the Like button and Fan box