Javascript 资源被解释为样式表但使用 mime 传输
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30475882/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Resource interpreted as Stylesheet but transferred with mime
提问by Kayelder
Fellow Coders,
各位编码员,
I am having this error in my website when i uploaded it to my FTP: Resource interpreted as Stylesheet but transferred with MIME type text/plain
当我将它上传到我的 FTP 时,我的网站出现此错误:资源被解释为样式表但使用 MIME 类型文本/纯文本传输
</head>
<body>
<div class= "navbar navbar-inverse navbar-fixed-top">
<div class="container">
<a href="#" class="navbar-brand">BlahBlahism</a>
<button class="navbar-toggle" data-toggle = "collapse" data-target= ".navHeaderCollapse">
<span class = "icon-bar"></span>
<span class = "icon-bar"></span>
<span class = "icon-bar"></span>
</button>
<div class="collapse navbar-collapse navHeaderCollapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="Responsive.html">Home</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
</div>
</div>
<div class="navbar navbar-inverse navbar-fixed-bottom">
<div class="container">
<p id="pcolor">BlahBlahism | ? Copyright </p>
</div>
</div>
</body>
Here are my scripts
这是我的脚本
<html>
<head>
<link rel="stylesheet" href="responsive.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="bootstrap-3/js/bootstrap.js"></script>
<script src="bootstrap-3/js/bootstrap.min.js"></script>
<link href="bootstrap-3/css/bootstrap.min.css" rel="stylesheet"
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
回答by Goodbye StackExchange
OP forgot to upload his responsive.css, and it wasn't found. Ensure you have uploaded that file to the root folder.
OP忘记上传他的responsive.css,并且没有找到。确保您已将该文件上传到根文件夹。
As shown below, you can see if this is happening in the network tab (F12 in firefox or chrome under the developer tools). You can also click on the mystyle.css, and click "Response" to view what was downloaded and ensure you're seeing the correct stylesheet.
如下图,您可以在网络选项卡(firefox 中的 F12 或开发者工具下的 chrome 中的 F12)中查看是否发生这种情况。您还可以单击mystyle.css,然后单击“响应”以查看下载的内容并确保您看到正确的样式表。


If you navigated to the css file, you would see that it goes to your hosting providers 404 error page, instead of the correct .css file.
如果您导航到 css 文件,您会看到它转到您的托管服务提供商 404 错误页面,而不是正确的 .css 文件。

