Is new menu WC3 XHTML Compliant?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
jamjam
Beginner
Beginner
Posts: 5
Joined: Thu Oct 23, 2003 4:31 pm
Contact:

Is new menu WC3 XHTML Compliant?

Post by jamjam »

I have to keep my pages validated: http://validator.w3.org/ and the new menu is giving me some xhtml errors.

Should it be going through smoothly or should I be tinkering some more?

Julie
http://www.uua.org
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Exactly what errors are you getting?

We are trying to be compliant and assessable as well. Tough, sometimes, but we try.

Thanks.
John
jamjam
Beginner
Beginner
Posts: 5
Joined: Thu Oct 23, 2003 4:31 pm
Contact:

Post by jamjam »

Hi John,

You are so fast!

Too many errors to list here but you can take a look at one the reports:
http://validator.w3.org/check?uri=http% ... ww.uua.org

I thought adding quotes in certain spots (text="javascript" etc) was the key but that rendered the menu null and void :)

Julie
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Ah, HA :!: I see some errors of your own in there. Was worried it was only us... :roll:

As for the JS call errors, I have done this on my sites, and I think somebody mentioned it here on the board as well. Put the JS statements in the menu calls into their own file and get them with an include. That way you can get rid of all the 'funny stuff' in there and make them look like normal JS statements.

That make any sense?
John
jamjam
Beginner
Beginner
Posts: 5
Joined: Thu Oct 23, 2003 4:31 pm
Contact:

Post by jamjam »

ahh there are some errors - my co-worker not me :)

As it stands no the JS errors are in an include, not by themselves, but an include nonetheless. I'll try it and search around the menu board some more.

Thank you!

Julie
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Here's the one I was thinking about...
The following is not XHTML compliant. Although it may not be considered a "bug", I thought I would raise the issue again.

<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>

My workaround has been to call this sciprt in a separate .js file. Please refer to
http://www.dracoblu.com
Not sure if he ran it through the validator, however.
John
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

I posted the CDATA method in the final bug section, I got W3 validation perfect.

Regards,
maz
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Thanks, Maz. Hopefully it will help Julie...

Code: Select all

<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>    
<script language=JavaScript  type="text/javascript"> 
//<![CDATA[ 
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>
Were you using it as an include, or directly in your HTML?
John
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Its on my template below body. Any script on an xhtml page must have the CDATA.

Regards
maz
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

If you guys don't mind my asking, what exactly is the point of this compliance? Does it help things render better? faster? Or is it a way to get everyone on the same pages to that future versions of web scripting languages and browsers can work better together? Kinda wet behind the ears on this topic...
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Basically it's writing code to conform to the W3C standards, Dave. They make the rules, as you know, so might as well follow them. Compliance should make things run better. In fact, as you move 'up' the ladder (HTML - XHTML - XML, etc.), things start going wrong a lot faster if you are not in compliance. But until the browsers decide to get in line it's still going to be a battle.

You can run your code through their checker at http://validator.w3.org/.
John
Post Reply