html - Is the 'type' attribute necessary for <script> tags? -
i've seen both this:
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
and this:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
does type attribute matter in way?
for html 4.x, type
attribute required. (w3):
this attribute specifies scripting language of element's contents , overrides default scripting language. scripting language specified content type (e.g., "text/javascript"). authors must supply value attribute. there no default value attribute.
for html 5, optional. if not specified, defaults text/javascript
. (w3):
the type attribute gives language of script or format of data. if attribute present, value must valid mime type. charset parameter must not specified. default, used if attribute absent, "text/javascript".
Comments
Post a Comment