History of the HTML Script Tag (JavaScript) (2011)
The Evolution of the Script Tag
Yesterday, i removed all type="text/javascript" on my site. That is:
<script type="text/javascript">
becomes
<script>
This is a story of political chaos of the web.
- In the beginning of time, a time of Netscape kingdom, ~1996, it was just
<SCRIPT>. - Then, with Microsoft's meddling, with JScript and VBScript, it became
language="JavaScript"orlanguage="JScript". - By ~1999, a entity called W3C emerged, over-peering correctness on earth, it declared that the attribute should be
type="text/javascript", and is required. - However, in practice, both the “language” and “type” are always optional, and no browser's parser actually give a flying fuck about it.
- Then, around ~2007, the standard body changed its mind and thought that the type really should be
type="application/javascript"ortype="application/ecmascript". Nobody in their right mind ever used that. - Then, in our glorious HTML5 era, ~2009, ruled by Google and Apple, in their HTML5 spec, it's back to
<script>.
History: HTML Script Tag Survey, Year 2006
the following is written around 2006.
In practice, you'll see
type="text/javascript"
instead of
type="application/javascript"
The text/javascript is still ok, but has been deprecated since 2006-04.
Of existing code on the web, you will also see:
<script language="JavaScript">...</script>
or just
<script>...</script>
The language= is the original specification when Netscape invented JavaScript in 1997.
Later on, standard bodies invented the type= and made it a required attribute.
However, as of 2005-08, major websites do not clearly show any of them
winning the popularity contest:
- amazon.com uses both
type=andlanguage=and sometimes just thelanguage=. - apple.com uses just the
language=. - yahoo.com uses just the
language=. - orkut.com uses just the
type=. - msn.com sometimes uses both, sometimes one or the other.
- ebay.com sometimes uses both, sometimes one or the other.
- google.com simply uses just
<script>
For all practical purposes, one can just use
<script>
and it doesn't make any difference. If you want your code to conform to w3c standard, use
<script type="application/javascript">
. This is recommended in RFC4329 (published in 2006-04), which also declares
text/javascript
as obsolete.
Xah Talk Show
JavaScript history
- History of JavaScript, 1995 to 2025.
- The Ugly JavaScript. 2010 to 2026
- the History of JavaScript, by Brendan Eich. 2008
- HTML History Timeline. 1993 to 2011
- Netscape Browser Sucks (2002)
- JS: Version History. 1995 to 2025
- JavaScript history, prototype.js (2005 to 2010)
- JS: ECMAScript New Features. 2015 to 2026
- History of the HTML Script Tag (JavaScript) (2011)
- JavaScript History. Sharp Variable for Circular Reference (via Common Lisp Reader Macro Syntax)
- JavaScript the Good Parts, Douglas Crockford. 2008
- JavaScript The Definitive Guide by David Flanagan. 2011, 2020.
- History of Node.js by Ryan Dahl 2011 📺
- Apache vs Node.js vs NGINX 📺. (2013 humor)
- History of Angular.js (2018)
- CoffeeScript or JavaScript (2011)
- TypeScript Will Kill CoffeeScript and Dart (2012)
- Microsoft Apple Mozilla Dismiss Dart (2011)
- Stackoverflow dolts on JavaScript Compiler ES2015 to ES5. (Babel.js) (2014)
- JavaScript Brendan Eich on Fixing String Methods on Emoji (2019)
- JavaScript. Why not create a directive “use new js” to fix warts? (2019)
- JS: CommonJS Module System. 2009 to 2026
- JS: AMD Module System and history (2009 to 2016)
- npm Disease (2021)