Jag använder mig av
Kod:
<script type="text/javascript" src="script.js"></script>
Har fått uppmaning från flera håll att man ska använda typen application/javascript istället, men kan meddela att det gick en eftermiddag åt att felsöka IE som inte fattar det.
Så kör med text/javascript.
Type-attributet är dessutom obligatoriskt attribut enligt w3c.
Citat:
Ursprungligen postat av W3C
type %ContentType; #REQUIRED -- content type of script language --
...
This attribute specifies the scripting language of the element's contents and overrides the default scripting language. The scripting language is specified as a content type (e.g., "text/javascript"). Authors must supply a value for this attribute. There is no default value for this attribute.
|
Detta gäller även för script som inte ligger i externa filer.