Evolution of the Script Tag

By Xah Lee. Date: .

A Story of Web Tech Politics: The Evolution of JavaScript's 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" or language="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 faak about it. Then, around ~2007, the standard body changed its mind and thought that the type really should be type="application/javascript" or type="application/ecmascript". (See: Internet media type) 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>.