If the document is parsed as HTML5, the language will be JavaScript by default, and no attribute of any type is required (for future reference, there is no language attribute in HTML5).
If you use HTML 4.x or XHTML 1.x, the default scripting language is supposedly determined from the value of the Content-Script -Type header, whether it is present locally in the META / meta meta tag (high priority) or as an HTTP header (low priority). The type attribute still requires HTML 4.x, even if the Content-Script -Type header is present (locally or otherwise), since the default scripting language only affects how the values ββof attributes such as onload, onclick, etc. are processed ., Type attribute with text / javascript, since the value should be used in the case of JavaScript instead of the language attribute if you do not use old browsers (for example, IE4, NN4, perhaps IE5 / Mac?), Remember that version IE6 for Windows 98, therefore, the language attribute is definitely out of date).
One last bit of information: technically speaking, application / x-javascript is the right value for JavaScript (unless it has become an application / javascript if I don't know), but unfortunately text / javascript is the one that has the most support in terms of multi-browser compatibility.
Dustin Apr 13 2018-10-10T00: 00Z
source share