最近,项目中加入了Bootstrap进行界面优化,但是,项目加载运行之后,控制台总是提示以下错误信息:

GET http://localhost:8080/.../fonts/fontawesome-webfont.woff2?v=4.3.0

Resource interpreted as Font but transferred with MIME type font/x-woff:"http://localhost:8080/.../fonts/fontawesome-webfont.woff2?v=4.3.0"

后来,在网上查找资料,了解到这是由于WOFF fonts缺少官方MIME类型定义引起的。WOFF fonts具有以下几种MIME类型:

  • font/x-woff
  • application/x-font-woff
  • application/font-woff
  • font/woff

WOFF fonts的官方MIME类型是application/font-woff,但是默认的IIS7并没有定义WOFF fonts的官方MIME类型,所以他不知道该采用以上哪一种MIME类型对WOFF font文件进行操作,因此匹配的时候就会报404错误。

解决方法:在IIS7中定义WOFF fonts的官方MIME类型application/font-woff。

在web.config中加入以下代码:

<system.webServer>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
</staticContent>
</system.webServer>

重新生成解决方案后运行,控制台就不会再报这个错误了。

Chrome: Resource interpreted as Font but transferred with MIME type font/x-woff的更多相关文章

  1. Chrome 报 Resource interpreted as Script but transferred with MIME type text/plain 警告的解决办法

    http://www.2cto.com/os/201312/262437.html 安装了VS2012之后,chrome在加载页面的时候会报 Resource interpreted as Scrip ...

  2. Resource interpreted as Script but transferred with MIME type text/plain:

    我用script做ajax跨域,请求返回的是个文本字符串,chrome提示:Resource interpreted as Script but transferred with MIME type ...

  3. 解决IE浏览器中出现“Resource interpreted as Document but transferred with MIME type application/json”问题

    在上传图片时,使用ajax提交,返回的数据格式为json.在测试时发现IE浏览器中,上传图片后,没有显示图片,而是弹出一个提示:是否保存UploadImg.json文件:而在其他浏览器中正常. 在Ch ...

  4. odoo 错误 Resource interpreted as Stylesheet but transferred with MIME type application/x-css:

    odoo8   页面内容显示一半,  web 控制台显示错误  Resource interpreted as Stylesheet but transferred with MIME type ap ...

  5. Resource interpreted as Stylesheet but transferred with MIME type text/plain

    今天碰到了Resource interpreted as Stylesheet but transferred with MIME type text/plain 这个错误. 原因:在web中配置了f ...

  6. Django 导入css文件,样式不起作用。Resource interpreted as Stylesheet but transferred with MIME type application/x-css

    笔者今天在模板中加载css文件时,发现 css样式能够下载再来却无法起作用,而且,图片.js都能够正常使用. 并且 浏览器提示: Resource interpreted as Stylesheet ...

  7. 样式加载不出来,浏览器控制台报错:Resource interpreted as Stylesheet but transferred with MIME type text/html

    写登录的时候出现的问题,样式时好时坏,浏览器控制台看到的信息是: Uncaught SyntaxError: Unexpected token <Resource interpreted as ...

  8. Resource interpreted as Document but transferred with MIME type application/json laravel异常请求返回警告

    一般情况下,laravel在方法里可以向前端返回数组格式 return [], 框架可以自动将数组转成JSON字符串返回,但浏览器会报MIME类型警告, 如是做APP接口可以忽视该警告: 但在前端aj ...

  9. Resource interpreted as Document but transferred with MIME type application/json

    转自:https://blog.csdn.net/just_lover/article/details/81207472 我在修改并保存后,界面返回提示“undifine”,实际我是看到有返回提示的. ...

随机推荐

  1. android虚拟机

    参考:http://baike.baidu.com/link?url=06bC3y5DSQ7DQ_QbEr6hTfMNpmg2f-39w6FpU69xxkbNoJ5OR4N9xCKoMwMMGTZfF ...

  2. java_method_数据去重

    /** * 判断list本身是否有重复数据和标题 * * @param list * @return newList 返回没有重复数据的list */ public List<String[]& ...

  3. HTML5离线篇收藏--- cache manifest

    自从翻译了<解读 HTML5:建议.技巧和技术>,就一直没有时间去看 HTML5 相关的东西.上周一次偶然的工作间隙折腾了下 Cache Manifest .当时直接拿博客当测试环境,虽然 ...

  4. JDBC 工具类

    在Java编程过程中 我们需要连接数据库 所以数据库的连接和增删改查操作是非常基本的操作同时又非常的重要.同时在JDBC编程中 ,有很多的方法如更新个查找操作,我们可以对其进行封装,提高我们编码的效率 ...

  5. Mapped Statements collection does not contain value fo

    Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入name ...

  6. MD5加密字符串

    public static String md5(String string) { byte[] hash; try { hash = MessageDigest.getInstance(" ...

  7. 分享Db4o的便捷封装类源码

    导言 大家好,话说真是好久好久没写文章了,哈哈. 最近在写网站,个人对传统数据库天然抵触,感觉非常繁冗,即便是Entity Framework也过于庞杂了,Db4o这种轻量级且读写.配置都极其方便的新 ...

  8. svchost占用cpu

    发现有一个svchost始终占用cpu. 查看任务管理器PID列,在tasklist /svc中查找相关列,对应若干服务. 一个一个检查这些服务,确认是windows update服务引起,停止win ...

  9. Linux基本权限学习

    概念 权限就是用户对资源所能进行的操作 -- 这里涉及到三个重要的概念:用户.资源.操作. 首先,Linux中用户分为:u.g.o,就是用户.用户组.其他用户.--这里的用户是指拥有者!!!务必记住! ...

  10. 强大的Spring缓存技术(下)

    基本原理 一句话介绍就是Spring AOP的动态代理技术. 如果读者对Spring AOP不熟悉的话,可以去看看官方文档 扩展性 直到现在,我们已经学会了如何使用开箱即用的 spring cache ...