Solution 1 :

I made the project using Intelij

Your IDE isn’t really relevant (unless you are using some sort of built-in web server that comes with it: if you are you should make that explicit in the question).

Why is this happening

Something is wrong with your HTTP server. You haven’t said what server you are using (or provided the code for it if you’ve written it yourself).

Why is this happening even thought I put type=”text/javascript inside the script tag?

The type attribute (when given a MIME type, the module value is a special case) tells the browser what to expect to get in the response to a request for the script’s URL. This lets the browser avoid requesting scripts in programming languages it doesn’t understand. The HTTP response headers are still authorative.

Problem :

I have the following error on all my JS files:

The script from “http://localhost:8086/home/js/classie.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.

I made the project using Intelij and TomCat web server, the code for the scripts inside HTML5 looks like this:

<script type="text/javascript" src="js/script-delete-word.js"></script>

Why is this happening even thought I put type="text/javascript inside the script tag? The same problem is for the .css files too, I tried to change the location of js and css folder, but it didn’t worked.

Comments

Comment posted by Alexandru Buruiana

I’m using tomcat web server. What files should I check for the HTTP server? I didn’t wrote the code for the web server.

Comment posted by tomcat.10.x6.nabble.com/…

tomcat.10.x6.nabble.com/…

By