Chrome: Resource interpreted as Font but transferred with MIME type font/x-woff
最近,项目中加入了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的更多相关文章
- 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 ...
- Resource interpreted as Script but transferred with MIME type text/plain:
我用script做ajax跨域,请求返回的是个文本字符串,chrome提示:Resource interpreted as Script but transferred with MIME type ...
- 解决IE浏览器中出现“Resource interpreted as Document but transferred with MIME type application/json”问题
在上传图片时,使用ajax提交,返回的数据格式为json.在测试时发现IE浏览器中,上传图片后,没有显示图片,而是弹出一个提示:是否保存UploadImg.json文件:而在其他浏览器中正常. 在Ch ...
- 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 ...
- Resource interpreted as Stylesheet but transferred with MIME type text/plain
今天碰到了Resource interpreted as Stylesheet but transferred with MIME type text/plain 这个错误. 原因:在web中配置了f ...
- Django 导入css文件,样式不起作用。Resource interpreted as Stylesheet but transferred with MIME type application/x-css
笔者今天在模板中加载css文件时,发现 css样式能够下载再来却无法起作用,而且,图片.js都能够正常使用. 并且 浏览器提示: Resource interpreted as Stylesheet ...
- 样式加载不出来,浏览器控制台报错:Resource interpreted as Stylesheet but transferred with MIME type text/html
写登录的时候出现的问题,样式时好时坏,浏览器控制台看到的信息是: Uncaught SyntaxError: Unexpected token <Resource interpreted as ...
- Resource interpreted as Document but transferred with MIME type application/json laravel异常请求返回警告
一般情况下,laravel在方法里可以向前端返回数组格式 return [], 框架可以自动将数组转成JSON字符串返回,但浏览器会报MIME类型警告, 如是做APP接口可以忽视该警告: 但在前端aj ...
- Resource interpreted as Document but transferred with MIME type application/json
转自:https://blog.csdn.net/just_lover/article/details/81207472 我在修改并保存后,界面返回提示“undifine”,实际我是看到有返回提示的. ...
随机推荐
- 在svg中的line和path根据路径返回x,y
由于path有自带的api可获得总长度,和某个长度返回的坐标. var total = d.path.getTotalLength();//返回总长度 var point = d.path.getPo ...
- 配置FastReport,FastReport报表加载不出来
插件链接: Demo地址:http://pan.baidu.com/s/1dEXUvsP FastReport.Net软件地址:https://pan.baidu.com/s/1c2kNBVi ...
- Smarty模板函数
1.{$var=...} 这是{assign}函数的简写版,你可以直接赋值给模版,也可以为数组元素赋值. <{$a = 10}><!--赋值语句--> <{$a}> ...
- Android获取时间2
Android开发之获取系统12/24小时制的时间 时间 2014-08-19 08:13:22 CSDN博客 原文 http://blog.csdn.net/fengyuzhengfan/art ...
- DUILIB圆形头象
#ifndef __UIHEADICON_H__#define __UIHEADICON_H__ /* 名称:圆形头像控件(派生CButtonUI类)*/ class CHeadUI: public ...
- C#中的线程(一)入门
文章系参考转载,英文原文网址请参考:http://www.albahari.com/threading/ 作者 Joseph Albahari, 翻译 Swanky Wu 中文翻译作者把原文放在了& ...
- sublimeText3安装emmet(For Mac)
每次重装st,安装emmet都困难重重,对上一次依照网上查的资料一步步做好了,这次又忘了如何操作,结果又是网上搜索打开一箩筐的网页. 终于决定,把这些惨痛的经历记录下来,要用的话自己看,也可能可以帮助 ...
- Nginx配置proxy_pass
nginx配置proxy_pass,需要注意转发的路径配置 1.location /test/ { proxy_pass http://t6:8300; } 2.location /test/ { p ...
- 几个开源XMPP Android客户端简单比较
想做个基于xmpp的即时通讯工具,服务端已经基本成型了.当然需要客户端需要配合,PC端基于spark进行改造,手机端先从Android入手(IOS估计一个人是搞不过来了). 原本Android开发 ...
- Linux_arm驱动之按键模拟脉冲实现定时器的精确计时
/***************************************************************** 内核驱动部分button_ker.c ************** ...