最近,项目中加入了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. 在powerdesigner中,一个table,怎么在diagram中创建多个symbol

    两种方式 第一:可以创建多个diagram,直接把表拖到diagram中就可以 第二:复制->粘贴快捷方式,或者Ctrl+C先复制,再Ctrl+K粘贴到Diagram中 说明: ctrl+V 是 ...

  2. OpenLDAP双主

    1:主A服务器           然后重新生成配置文件数据       主B服务器             注意:两个主服务器的rid必须得一样   在做主从的时候,必须得安装必要的软件包,comp ...

  3. java环境配置步骤

        1. jdk下载 官网:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html ...

  4. 【循序渐进MVC】第一回——一物多用Project.json依赖关系之dependencies节点

    Project.json统一了ASP.NET vNext之前版本的packages.config.NuGet 配置(nuspec)以及项目文件(csprojs):并集成在Project.json中. ...

  5. opencv单目摄像机标定(一)

    #include <string> #include <iostream> #include <cv.h> #include <highgui.h> u ...

  6. I/O复用

    1.I/O模型 一个输入操作通常包括两个不同阶段:等待数据准备好:从内核到进程拷贝数据. 阻塞I/O模型 非阻塞I/O模型 I/O复用模型:内核发现进程指定的一个或多个I/O条件就绪,它就通知进程,由 ...

  7. iOS中坐标转换

    坐标转换,可以用UIVIew的方法 //由要转换坐标view的superView执行该方法,rect为待转换view的frame,view是要显示到哪儿的 - (CGRect)convertRect: ...

  8. Android开发学习笔记:浅谈显示Intent和隐式Intent

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://liangruijun.blog.51cto.com/3061169/655132 ...

  9. git & scp

    git & scp command : git & scp git git 提交 git checkout/pull =====[在提交前校验远程是否有冲突] git add [< ...

  10. CR LF的由来

    学习Esperanto时用到一款叫做Kajero的软件,支持世界语特殊字符编辑. 在Option菜单中有个选项,End of line 列出了四种换行方式 这四种都是由基本CR和LF组成.那么CR和L ...