网站不会在IE中使用fb HTML属性显示Facebook喜欢按钮

时间:2013-04-02 20:51:39

标签: html wordpress web wordpress-plugin wordpress-theming

任何帮助都会非常感激。我一直在寻找并试图解决这个问题几个星期,但无济于事。

我的Wordpress网站拒绝在IE中显示我喜欢的facebook按钮。是的,我已经将facebook HTML属性放在代码中,但仍然没有。我有两个实例,我一直在尝试使用Like按钮,这是一个Wordpress小部件(简单的Facebook连接)以及HTML代码。这是我第一次在我的某个网站遇到过这样的问题而且在这家公司上线之前我需要一些可怕的帮助。再次,任何帮助将不胜感激。代码如下所示。

<!DOCTYPE HTML>
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if IE 9 ]><html class="ie ie9" lang="en"> <![endif]-->
<!--[if !IE]><!--><html <?php language_attributes(); ?> <!--<![endif]-->
<head>

与按钮代码类似:

<div id="fb-root"></div>

<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&appId=546891755321471";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<fb:like href="http://www.facebook.com/livecarepc" send="false" layout="standard' width="200" show_faces="true" colorscheme="dark"></fb:like>

谢谢!

1 个答案:

答案 0 :(得分:1)

Internet Explorer可以非常特别地提供正确的类型信息集(doctype,css,scripts等)。在这种情况下,<script>标记不足以触发IE显示Facebook之类的按钮,这在旧版本的IE中可能尤其如此。

要修复“赞”按钮代码中的<script>替换<script language="JavaScript">