Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:40

type="text/javascript" missing?


Poster: Davidk
Dated: Friday February 27 2004 - 9:37:30 GMT

Hi!

When I validate my template page: http://www.davidkarlsson.se/mall.shtml

in the W3 HTML-validitor, i get the following result:

Line 19, column 29: required attribute "TYPE" not specified.
<script language="JavaScript">


This is in reference to my menu which happens to end up on line 19 according to the following:

Code:
<script language="JavaScript" src="/includes/milonic_src.js" type="text/javascript"></script>   
  19: <script language="JavaScript">
  20: if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/includes/mmenuns4.js><\/scr"+"ipt>");      
  21: else _d.write("<scr"+"ipt language=JavaScript src=/includes/mmenudom.js><\/scr"+"ipt>");
  22: </script>
  23: <script language="JavaScript" src="/includes/menu_data.js" type="text/javascript"></script>


Has the type="text/javascript" been left out on purpose in the menu call on this line, or is there a need for me to add it? And does it make a difference?

Thanks!

David

Re: type="text/javascript" missing?


Poster: kevin3442
Dated: Friday February 27 2004 - 16:59:02 GMT

Davidk wrote:
...Has the type="text/javascript" been left out on purpose in the menu call on this line,

I'm only guessing here, but I'd say that it probably was left out on purpose because Andy deemed it unnecessary. His style tends toward an economy of characters, to produce faster-loading code, so he leaves out things that aren't necessary. Witness, for example, that when he does set the type attribute in the <script> tag, he often omits the double quotes around the value.

Quote:
...or is there a need for me to add it?

No real need... it'll work fine without it. But HTML 4.0 validators will probably point it out to you.

Quote:
...And does it make a difference?

I'd have to say "no"... at least not in a functional sense. On the other hand, if it'll give you peace of mind and eliminate a validator concern, then put it in... won't hurt any.

Here's a quote from a reference on HTML 4.0:
Quote:
The required TYPE attribute of SCRIPT specifies the media type of the scripting language, e.g., text/javascript. However, most browsers only support the deprecated LANGUAGE attribute, which specifies the language name. Examples of supported LANGUAGE values include JavaScript, JavaScript1.1, and VBScript. The values are not case sensitive.

I read this to mean that the type attribute is "required"... but not really. Typical...

Hope that helps,

Kevin


Poster: Davidk
Dated: Sunday February 29 2004 - 11:08:24 GMT

Thanks Kev! You just gave me peace of mind!

David

Put it in


Poster: DHTML Kitchen
Dated: Sunday February 29 2004 - 15:55:45 GMT

I would include it.

When a page uses invalid markup, it may be difficult to determine the source of bugs or other unexpected behavior that your page may display.