+ 1

What coding languages can you put in HTML using the script tag?

17th Dec 2018, 3:23 AM
Riley
Riley - avatar
3 Answers
+ 3
Please read the following closely and with caution as not all languages will render in all web browsers but that does not mean that they cannot be used inside the <script> tag... And it may also depend on the particular source code playground / website structure area reserved for creating your website or app https://stackoverflow.com/questions/2872037/what-language-types-are-allowed-in-the-html-script-tag https://www.w3.org/TR/REC-html40/interact/scripts.html
17th Dec 2018, 4:18 AM
BroFar
BroFar - avatar
+ 2
[meta / note]... the fact that anything is allowed in the <script type="..."> tag means that some 'typical' behaviors have appeared relying on the fact that the scripting engine ignores unrecognized types: 1. type="javascript/worker" tends to identify real javascript that will be loaded as a background worker later 2. type="text/plain" can be used for an in-script text file that you want to "read" 3. type="whatever" id="ES6" can be used to mix ES5/ES6 in the same code without the script engine insta-crashing on unsupported mobiles. 4. webgl fragment or shader code, etc... (All of the above works here)
17th Dec 2018, 5:27 AM
Kirk Schafer
Kirk Schafer - avatar
+ 1
Thanks Kirk Schafer for the footnotes Have you found any of the others to work here or just the few you mentioned such as text/python text/ruby and other variations...
17th Dec 2018, 5:42 AM
BroFar
BroFar - avatar