homepage Welcome to WebmasterWorld Guest from 54.196.168.78
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved