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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -