homepage Welcome to WebmasterWorld Guest from 54.242.231.109
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

    
Mime Type for external js file
Can't find right mime to validate document
jimbeetle




msg:1494038
 10:09 pm on Apr 22, 2003 (gmt 0)

Ran a few pages through the W3C validator (4.01 Transitional) and it keeps asking for a "type" declaration when calling an external javascript.

<script language="JavaScript" type=" " src="js/thisfile.js">

I've tried type="text" and type="text/plain" and a couple of subtypes I made up myself and nothing seems to work.

Actually, "text" and "text/plain" validate but the script doesn't execute when the page is loaded.

Any ideas, or just live with it?

Jim

 

tedster




msg:1494039
 10:16 pm on Apr 22, 2003 (gmt 0)

type="text/javascript"

jimbeetle




msg:1494040
 10:28 pm on Apr 22, 2003 (gmt 0)

Thanks tedster. Tried that first, must have had a typo somewhere or brain is totally mush.

Strange thing is I now of course remember always having the type declared. Don't know when or why I changed it. Oh well, nevermind. Think I'm going to call it cocktail time.

g1smd




msg:1494041
 12:16 am on Apr 23, 2003 (gmt 0)

While you are discussing the code for external Javascript, I'll also throw in the code for calling external CSS with a one line instruction in the <head> section:
<link type="text/css" rel="stylesheet" src="/path/file.css">

External CSS files must not contain any HTML tags or code.

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