Internet Explorer中未加载CSS(SEC7113) [英] CSS is not loaded at all in Internet Explorer (SEC7113)
问题描述
我有一个AngularJS网站,它在每个浏览器中工作完美。但是在Internet Explorer中(使用版本11测试)未完全加载CSS。
错误代码:SEC7113
错误消息:由于mime类型不匹配,系统忽略了CSS
=http://msdn.microsoft.com/en-us/library/hh180764(v=vs.85).aspx> http://msdn.microsoft.com/en-us/library/hh180764(v = vs85).aspx
这是我如何包含我的CSS(前面):
< link rel =stylesheettype =text / csshref =css / app.css>
这也是我的Doctype:
<!doctype html>
< html ng-app =app>
我知道肯定(100%),它几个星期前在Internet Explorer工作,因为我在不同的浏览器中测试性能。从那时起,CSS改变了很多。但不是我包括CSS的方式。
有人知道,这里可能是什么问题?非常感谢!
这里的问题是CSS文件的无效mime类型。这可能是你的CSS文件实际上是用像 text / plain
而不是 text / css
。因此,Internet Explorer阻止文件加载,以避免潜在的攻击媒介。
当人们引用来自GitHub的JavaScript文件时,这个问题最明显以 text / plain
mime类型提供,但在文档中被作为 text / javascript
使用。 / p>
确保您的响应头包含 text / css
mime类型,此信息位于网络面板下的F12开发人员工具中。
I have an AngularJS Website, which works perfectly in every browser. But in Internet Explorer (tested with version 11) CSS is not loaded at all.
Error Code: SEC7113
Error Message: "CSS was ignored due to mime type mismatch"
Also check here: http://msdn.microsoft.com/en-us/library/hh180764(v=vs.85).aspx
This is how I include my CSS (right before ):
<link rel="stylesheet" type="text/css" href="css/app.css">
Also This is my Doctype:
<!doctype html>
<html ng-app="app">
I know for sure (100%), that it worked in Internet Explorer few weeks ago, since I tested the performance in different browser. Since then, the css changed a lot. But not the way I include the CSS.
Does anybody know, what could be the problem here? Thank you very much!
The problem here is with an invalid mime-type for the CSS file. It's possible your CSS file is actually being sent down with a mime-type like text/plain
instead of text/css
. As a result, Internet Explorer prevents the file from loading so as to avoid potential attack vectors.
This problem was most notably seen when people would reference JavaScript files from GitHub, which are served with text/plain
mime-types, but inteded to be used as text/javascript
in the document.
Ensure that your response headers contain the text/css
mime-type and you should be fine. This information is available in the F12 Developer Tools under the Network panel.
这篇关于Internet Explorer中未加载CSS(SEC7113)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!