仅限 IE8:Facebook Like Box 不显示
所以我和其他许多人一样遇到了一个问题:Facebook Like Box 无法在 IE8 中显示(IE7 正常)。 我发现了很多关于此问题的帖子,尝试了所有解决方案但没有成功...... IE8 消息:FB.FBXML Null 或不是对象
注意:有一个函数可以处理 FB Like Box 的大小调整。
这是我的 HTML5 代码:
<!doctype html>
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="fr" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="fr"> <!--<![endif]-->
<head>
...
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
</head>
<body>
...
<article>
<div class="row" id="content">
<div class="twelvecol last">
<div id="fb-root"></div>
<div class="fb-like-box" data-href="http://www.facebook.com/divstudio" data-width="1140" data-show-faces="true" data-stream="true" data-header="false"></div>
</div>
</div>
</article>
...
<script>
$(document).ready(function(){
var contentwidth = $('#content').width();
$('.fb-like-box').attr('data-width', contentwidth - '40');
FB.FBXML.parse(document.getElementsByClassName('.fb-like-box'));
});
</script>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</body>
</html>
有什么想法吗?
网站:http://www.divstudio.fr/emergenza/jazz/actu.html
非常感谢
So i've got a problem like many others : Facebook Like Box is not diplaying in IE8 (IE7 OK).
I found many posts about that, tried all solutions but did not succed...
IE8 message : FB.FBXML Null or not an object
NB : there's a function which handle resizing of FB Like Box.
Here's my HTML5 code :
<!doctype html>
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="fr" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="fr"> <!--<![endif]-->
<head>
...
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
</head>
<body>
...
<article>
<div class="row" id="content">
<div class="twelvecol last">
<div id="fb-root"></div>
<div class="fb-like-box" data-href="http://www.facebook.com/divstudio" data-width="1140" data-show-faces="true" data-stream="true" data-header="false"></div>
</div>
</div>
</article>
...
<script>
$(document).ready(function(){
var contentwidth = $('#content').width();
$('.fb-like-box').attr('data-width', contentwidth - '40');
FB.FBXML.parse(document.getElementsByClassName('.fb-like-box'));
});
</script>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</body>
</html>
Any ideas ?
website : http://www.divstudio.fr/emergenza/jazz/actu.html
thx a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该将这些行添加到标记中。
如果标签中已有任何属性,请保持原样。这样起始的html标签就变成这样了。
如果启用了缓存,请清除缓存。它应该在 IE-8 中工作
You should add these lines to the tag.
If there are already any attributes in the tag, leave them as it is. So that the starting html tag becomes like this.
Clear the cache if caching is enabled. It should work in IE-8
我遇到了同样的问题,并且添加适当的 xmlns 属性没有帮助。事实证明,导致我的问题与另一个问题有关: 当用户未登录 Facebook 时,类似 Facebook 的框不会显示。 Igy 和 wasim kazi 的答案引导我找到了解决方案。解决该问题的方法如下:
I had the same problem, and adding the appropriate xmlns attributes did not help. As it turns out, what was causing my problem is related to another problem: Facebook like box not showing up when user is not logged into Facebook. Igy and wasim kazi had the answers that led me to the solution. Here's how to solve the problem:
我对 drupal 6 的 facebook 模块有同样的问题。
我通过将标记类型从 XFBML 更改为 HTML5 解决了我的问题
,然后我在
部分:
我希望这也能解决您的问题。
I had the same issue with the facebook module for drupal 6.
I solved my problem by changing the markup type from XFBML to HTML5
I then added the HTML5 script in the
<head>
section:I hope this fixes your problem as well.