Click to See Complete Forum and Search --> : JavaScript type
Sonia
10-13-2003, 03:59 AM
What's the meaning of 'text' in the following tag : <script type = "text/JavaScript">
Is it wrong if I write <script type = "JavaScript">
What are the other options of the type attribute?
Charles
10-13-2003, 04:19 AM
That value should conform to RFC2045 (http://www.ietf.org/rfc/rfc2045.txt) and as such type="JavaScript" is incorrect. Other valid types that I have seen are "text/perlscript" and "text/tcl".
lillu
10-13-2003, 04:22 AM
It indicates the MIME type of the script. MIME types are used in headers to give indication on the data being passed between applications. Eg. when you send an email or get streamed video across the net, it's important to know what kind of data you're sending (eg. html, image, etc.)
text/html
text/javascript
text/jscript
text/vbscript
text/xml
All script languages are of text type. Other media types can be eg. application/xml
Here's a list on media-types.
http://www.isi.edu/in-notes/iana/assignments/media-types/media-types