2

I was reading a tutorial on HTML 5 Canvas Animation with javascript (of course). In the header, the author used
application/javascript which is rather new to me because I've only seen text/javascript used. Can anyone help? There is every likelihood this question has been asked before but I'm using a phone to do this so I can't see any similar questions.

Thanks

4

2 Answers 2

2
  • text/javascript - is obsolete
  • application/javascript - MIME type for JS

Guidelines:

  • Use application/javascript on the server to return MIME type
  • Use text/javascript for type attributes of <script> tag although it's not really required
Sign up to request clarification or add additional context in comments.

Comments

2

application/javascript is the correct MIME type for Javascript, although text/javascript shouldn't cause any issues

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.