Welcome to WebmasterWorld Guest from 54.196.224.166

Forum Moderators: open

Message Too Old, No Replies

Mime Type for external js file

Can't find right mime to validate document

     

jimbeetle

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

WebmasterWorld Senior Member jimbeetle is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

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

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



type="text/javascript"

jimbeetle

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

WebmasterWorld Senior Member jimbeetle is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

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

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.