W3C validation 2

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
pieter53
Super Advanced
Super Advanced
Posts: 44
Joined: Sat Nov 18, 2006 9:49 am
Location: Schoonoord, The Netherlands
Contact:

W3C validation 2

Post by pieter53 »

I have read this topic, but I'm not sure if I can use the same solution.

So here I go:
This is in the head of the document:

<script language="JavaScript" src="milonic_src.js" type="text/javascript"></script>
<script language="JavaScript">
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>"); </script>
<script language="JavaScript" src="menu_data.js"
type="text/javascript"></script>
<script type="text/javascript" src="tooltips.js"></script>


and this is what W3C tells me:

# Error Line 16 column 31: required attribute "TYPE" not specified.

<script language="JavaScript">

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.



What to do?

(I can't remember where I copied that part of the header from and if I realy need:
<script language="JavaScript">
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>"); </script>

, sorry!)


This is my site and I think your menu is wonderfull!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

It's telling you to put a type into the script tag that doesn't have it.

Code: Select all

 <script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");		
  else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>"); 
</script>
If you don't need to support NS4 you can just code the calls as:

Code: Select all

 <script language="JavaScript" src="milonic_src.js" type="text/javascript"></script> 
<script language="JavaScript" src="mmenudom.js" type="text/javascript"></script> 

<script language="JavaScript" src="menu_data.js" 
type="text/javascript"></script> 
<script type="text/javascript" src="tooltips.js"></script> 
Ruth
pieter53
Super Advanced
Super Advanced
Posts: 44
Joined: Sat Nov 18, 2006 9:49 am
Location: Schoonoord, The Netherlands
Contact:

Post by pieter53 »

Thanks!

I don't know if I need NS4 or not :oops:
I will try to find that out tomorrow.

Pieter, Schoonoord, The Netherlands
Post Reply