归档 2014年11月3日

百度CDN跨域引用Bootstrap Glyphicons字体异常

使用百度前端公共库CDN服务(https://libs.baidu.com)的站长需要引起注意:

如果站点引用了百度CDN提供的Bootstrap Glyphicons字体,在使用较新版本的浏览器(包括Chrome 38+,Firefox 33+,以及IE 11等)访问这些包含Glyphicons字体的页面时,会无法正确显示Bootstrap Glyphicons字体。

使用BootCDN服务(https://www.bootcdn.cn/)替换百度公共库CDN服务,可以解决上述问题。

通过Chrome浏览器开发者工具的Network选项卡查看资源请求,可见glyphicons字体文件的请求响应出现异常。

测试页面的代码如下:

<html>
  <head>
    <script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
    <script src="https://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <link href="https://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" />
    <style>
      p {
        margin: 15px;
        font-size: 20px;
        font-weight:bold;
      }
    </style>
  </head>
  <body>
    <p>&lt;script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;</p>
    <p>&lt;script src="https://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"&gt;&lt;/script&gt;</p>
    <p>&lt;link href="https://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" ...

继续阅读

昨天

明天

归档