Why type="text/ ???

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
I don't get it.

In the script tag you're meany to put:

Code:
type="text/javascript"

Why do you need to put the text bit?
It's not as if anyone is going to put binary in there?
 

kkenny

Active Member
Messages
1,950
Reaction score
0
Points
36
Well it's just how everyone (browsers and W3C) interpret the script text as. There's also text/css and the way they did things and a bunch of others if i dont recall. It's just generally accepted around the whole world of webdesign and code.
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
Kkenny is correct, its a standard that you should follow and that is universally accepted. The reason for doing it may have been because the creators of the standard wanted to leave the possibility for adding more types apart from text. But at the moment it seems pointless because as far as I know text is the only one.
 
Top