Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the difference between the script type and language attributes?

Language Script type
0
Posted

What is the difference between the script type and language attributes?

0

The script element’s type attribute specifies the content type of the script, which should always be text/javascript, the standard Multipurpose Internet Mail Extensions (MIME) type for Javascript. The “text” part signifies that the script is essentially a plain text format. The “javascript” part specifies the scripting language. The script element’s language attribute is now deprecated, which means that it should no longer be used in HTML. The language attribute used to specify a particular version of the Javascript language required to run the script, to provide a fall-back mechanism for web browsers that do not support more advanced scripting features. This was never a particularly good way to ensure script compatibility. Instead, you should use object, method and property detection to test the availability of specific scripting features before use. See Golden rules for Javascript for a guide to these defensive coding techniques. Actions: Follow-up, clarify or correct this answer. Su

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123