
The original way to include script (such as JavaScript) in your web site was through the use of the language attribute. See below:
<script language="JavaScript">
alert("Hello World");
</script>
This changed in HTML 4 though. In the specification, it indicated that the language attribute was being deprecated because the identifiers(or possible values) for the attribute were non-standard.
It instead recommended the use of the type attribute where the value would be the mime-type of the included script. See below:
<script type="text/javaScript">
alert("Hello World");
</script>
As a transition, it was perfectly fine to use both in case you were worried that some browsers didn't yet support one, or didn't still support the other; but moving forward you really should just be using the type attribute.
Of course, in HTML 5 this has been changed subtly; we'll look at that next time.
No comments:
New comments are not allowed.