Is it important to specify the MIME type when including a JS file?

I found myself including more and more external JS files from CDN sites, etc. I always see that some sites include the MIME type when copying HTML code with a tag <script>, and some do not. What is the importance of including a MIME type? Are there browsers that do not support scripts without a MIME type?

I also heard that the "official" MIME type for JavaScript is application/javascript, but it looks like everyone is using text/javascript. What are the consequences of using one of them?

+5
source share
1 answer

- HTML5. HTML- <!DOCTYPE html>, , .

HTML5 , script, <script src="myScript.js"></script>. application/javascript text/javascript, .

+2

All Articles