The resource is interpreted as Script, but passed with text like MIME / x-C ++

junior beginner.

Wrote test html below

<head> <link rel="stylesheet" type="text/css" href="404.less"> <script src="http://lesscss.googlecode.com/files/less-1.3.0.min.js" type="text/javascript"></script> </head> <body>test</body> 

But got a warning in Chrome

The resource is interpreted as Script, but passed with text like MIME / x-C ++: "http://lesscss.googlecode.com/files/less-1.3.0.min.js".

Why?

+6
source share
2 answers

You probably want your link tag to say:

 <link rel="stylesheet/less" type="text/css" href="404.less"> 

However, if this is being served from a web server, it may happen that it detects the wrong mime type from the file extension. If it is an Apache server, then there is an easy fix. Add this / create the .htaccess file to your webroot containing the line:

 AddType text/css less 
+10
source

I had a similar problem with twitter follow-me buttons when I was browsing local html files in chrome. To fix this, I simply launched the web matrix 2.0 and pointed to my folder. Hope this helps.

0
source

Source: https://habr.com/ru/post/920895/


All Articles