最近,项目中加入了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. SeekBar 圆角问题

    用图片做背景色,最后处理成.9.png的.用普通png图片做背景,则两边会有圆角出现,原因是图片不适合SeekBar尺寸,因而被拉伸或压缩,从而产生圆角. <?xml version=" ...

  2. linux命令(8):cp 命令

    cp命令用来复制文件或者目录,是Linux系统中最常用的命令之一.一般情况下,shell会设置一个别名,在命令行下复制文件时,如果目标文件已经存在,就会询问是否覆盖,不管你是否使用-i参数.但是如果是 ...

  3. spring web.xml 难点配置总结

    web.xml web.xml是所有web项目的根源,没有它,任何web项目都启动不了,所以有必要了解相关的配置. ContextLoderListener,ContextLoaderServlet, ...

  4. Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法

    报错信息: org.hibernate.event.internal.DefaultLoadEventListener onLoad INFO: HHH000327: Error performing ...

  5. WebMethod在webservice里面非静态方法能调用,在页面类里面,静态方法才能调用

    WebMethod在webservice里面非静态方法能调用,在页面类里面,静态方法才能调用

  6. 安装好grunt,cmd 提示"grunt不是内部或外部命令" 怎么办?

    Grunt和所有grunt插件都是基于nodejs来运行的,因此,必须安装node.js. (一) 去官网http://nodejs.org/ 下载安装包 node-v6.9.2.msi,直接点击安装 ...

  7. alphaBlend

    // Alpha = srcAlpha + dstAlpha - srcAlpha * dstAlpha / 0xFF;// R = (srcR * srcAlpha + dstR * dstAlph ...

  8. h5弹框去掉ip地址

    <script> window.alert = function(name){ var iframe = document.createElement("IFRAME" ...

  9. JS编码解码

    一.定义和用法 encodeURI() 函数可把字符串作为 URI 进行编码. 语法 encodeURI(URIstring) 参数 描述 URIstring 必需.一个字符串,含有 URI 或其他要 ...

  10. final评论II

    1.  Nice  项目:约跑软件       在此次六个发布作品中,此作品是唯一基于Androrid开发app.并且此作品创意和实用性很高的,跑步是人们日渐热爱的一个活动,用户广泛,并且在网上沟通交 ...