Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What other types can <script> have?

I've been wondering about this for quite a while, finally going to find out ;)

We have <script type="text/javascript">...</script>.

I have never seen any type but text/javascript, and sometimes the type attribute is even missing, defaulting to javascript anyway.

So, the question:

Is there any other use for the type attribute - any other script we can use?

like image 906
MightyPork Avatar asked Mar 11 '26 18:03

MightyPork


1 Answers

Available types are:

  • text/javascript
  • text/ecmascript
  • application/javascript
  • application/ecmascript

If you don't specify type, text/javascript is used.

Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script

like image 71
Raptor Avatar answered Mar 13 '26 09:03

Raptor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!