最近,项目中加入了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. CentOS 安装rz和sz命令

    虚机装了CentOS7.2最小版本, 结果上去后发现rz命令不能用 yum install lrzsz  安装完成:

  2. HDU 1251统计难题

    统计难题 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131070/65535 K (Java/Others)Total Submi ...

  3. IOS低版本遇到了坑不知道你遇到了没

    拿着项目给客户测试,客户那边三个人俩人水果手机是ios8以下版本,结果导致```(恭喜,坑出现!)总不能说老总!"您把版本升级到ios9 吧!

  4. Git常用命令学习(2)

    1):git branch -v --查看每一个分支的最后一次提交2):git branch --merged 与 --no-merged 这两个有用的选项可以过滤这个列表中已经合并或尚未合并到当前分 ...

  5. mysql创建新用户并分配数据库权限

    下面展示了如何在Linux中创建和设置一个MySQL用户. 首先以root身份登录到MySQL服务器中. $ mysql -u root -p 当验证提示出现的时候,输入MySQL的root帐号的密码 ...

  6. 关于oracle 10g creating datafile with zero offset for aix

    参考文档: 1.创建oracle数据文件时需要注意的地方(OS Header Block) http://www.aixchina.net/Question/20406 2.oracle 创建数据文件 ...

  7. CentOS 6 安装 MySQL-python

    yum install -y mysql-devel python-devel python-setuptools pip install MySQL-python

  8. Quarter square 查找表乘法器,手动建立rom

    建立一个C的范围为0~255,内容是(C)2/4的查表 占用256个存储空间,但可以计算出+-127的两个数之积.传统算法需要至少127×127个存储空间. 查找表模块的建立: module lut_ ...

  9. java中获取路径的几种方式

    总是忘记, 备份一下,方便下次用. 第一种: File directory = new File("");//参数为空 String courseFile = directory. ...

  10. c++11 实现单例模式

    C++11出来后,里面新增加了好多好用的功能 下面的单例就是使用了C++11中的标准库中的mutex和unique_prt 进行内存管理的. 此单例模式不用担心内存的释放问题 #pragma once ...