| Javascript 'type'
|
netcommr

msg:1485998 | 9:12 pm on Dec 18, 2001 (gmt 0) | | Netscape Navigator requires that external scripts be served with a Content-Type of application/x-javascript |
| QUOTE SOURCE [htmlhelp.com] I have always used type='text/javascript'. I know most browsers ignore the type atribute and take the 'language' attribute. | most browsers only support the deprecated LANGUAGE |
| The script I am using is external. I have tested in NS 4 + 6, Opera 5 + 6, IE 4.01+ all without the type attribute and it runs fine. My Q is should I even worry about using application/x-javascript as a type??
|
tedster

msg:1485999 | 9:38 pm on Dec 18, 2001 (gmt 0) | The quote you've posted doesn't refer to the HTML code but to the SERVER configuration. External .js files should be served as application/x-javascript, and most commercial hosts are so configured. The HTML code to call an external js file, on the other hand, is best written by including both the deprecated language attribute and the current type attribute: <script type="text/javascript" language="JavaScript url="code.js"></script>
|
netcommr

msg:1486000 | 10:13 pm on Dec 18, 2001 (gmt 0) | Your right... I should have not 'scanned' so quick and seen the "be served with" snip... thanks.
|
|
|