MightyPork MightyPork - 2 years ago 64
HTML Question

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
, and sometimes the type attribute is even missing, defaulting to javascript anyway.

So, the question:

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

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download