IE8 fbml喜欢按钮和eot(字体嵌入) [英] IE8 fbml like button and eot (font embedding)

查看:171
本文介绍了IE8 fbml喜欢按钮和eot(字体嵌入)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对我开发的网站之一有疑问。
情况是这样的:
我正在使用在fontsquirrel.com上生成的@ font-face,并且在每个浏览器中,除了IE8之外它都可以正常工作。一开始它也适用于IE8,但(我猜)更新后它会停止正常工作。
这就是发生的事情,加载页面后,页面上的字体保持不变,直到你将鼠标放在文档上,之后它应用@ font-face规则。
你可以在这里看到: http://devel.2klika.net/fiolic /demo/home.php
此外我在该页面上使用fbml为fb:like按钮,这是代码:

I have issue with one of site that I developing. Situation is like this: I'm using @font-face generated at fontsquirrel.com, and in every browser, except for IE8 it works fine. In the beginning it worked for IE8 too, but (I guess) after update it stops working normally. This is what's happening, after page is loaded, font on the page stays the same until you mouse over the document, after that it applies @font-face rule. You can see that here: http://devel.2klika.net/fiolic/demo/home.php Also I'm using fbml on that page for fb:like button, this is the code:

        <span style="float: right; position: relative; left: 10px;">
            <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
            <fb:like href="http://www.facebook.com/#!/pages/Mesnice-Fiolic/174173775933578" layout="button_count" show_faces="false" width="50" font="arial"></fb:like>
        </span>

我认为评论fb:喜欢解决,排序,@ font-face问题,喜欢这个:

I figured that commenting out fb:like is solving, sort of, @font-face problem, like this:

        <span style="float: right; position: relative; left: 10px;">
            <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
            <!-- <fb:like href="http://www.facebook.com/#!/pages/Mesnice-Fiolic/174173775933578" layout="button_count" show_faces="false" width="50" font="arial"> </fb:like> -->
        </span>

我想使用那个fb:like按钮,如果它可以使它与IE8和@ font-face:)

I would like to use that fb:like button if it is possible to make it work with IE8 and @font-face :)

我测试了这个用Windows 7 64bit,IE 8.0.7601.17514 64bit和32bit
如果我在兼容性视图中使用IE8它工作正常。
有谁能帮我解决这个问题?
提前致谢

I tested this with Windows 7 64bit, IE 8.0.7601.17514 64bit and 32bit If I'm using IE8 in compatibility view it works normally. Does anyone can help me with this issue? Thanks in advance

推荐答案

我在其他论坛上发现了很多关于添加名称空间到html标签的回复作为一种使这项工作的方式。我决定尝试自己,非常高兴,在IE8中显示了类似的按钮。

I had found a lot of responses on other forums talking about adding namespaces to the html tag as a way of making this work. I decided to try it my self and with great joy, the like button was displaying in IE8.

我改变了我的html标签:

I changed my html tag from:

<html>

to:

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">

如我在下面使用的代码中所示:

As seen in the code I used below:

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
</head>
<body>

<div><fb:like id="fb_like_btn_iframe" show_faces="no" width="220" href="http://www.pixorial.com"></fb:like></div>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  api_key = "<%= FACEBOOK['key'] %>";
  FB.init({
    appId  : api_key,
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
  });

  var like_clicked = function(href, widget){
    $.ajax({
      type : "POST",
      url : '<%= url_for :controller => :gallery, :action => :update_likes %>',
      data : {"url_of_like": href, "type": "like", "authenticity_token": <%= form_authenticity_token.inspect %>}
    });
    parent.likeButtonChanged(href);
  }

  var like_unclicked = function(href, widget){
    $.ajax({
      type : "POST",
      url : '<%= url_for :controller => :gallery, :action => :update_likes %>',
      data : {"url_of_like": href, "type": "unlike", "authenticity_token": <%= form_authenticity_token.inspect %>}
    });
    parent.likeButtonChanged(href);
  }

  $(document).ready(function(){
    FB.Event.subscribe('edge.create', like_clicked);
    FB.Event.subscribe('edge.remove', like_unclicked);
  })
</script>

</body>
</html>

这篇关于IE8 fbml喜欢按钮和eot(字体嵌入)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆