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:23
Page Validation
Poster: rww
Dated: Sunday June 20 2004 - 18:59:36 BST
The way that Milonic uses:
<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>
keeps pages from validating as XHTML 1.0 Transitional. I've run my pages through http://validator.w3.org/ and the errors I get are:
document type does not allow element "script" here
...itedesign/common/scripts/mmenuns4.js'><\/script>");
and,
character "<" is the first character of a delimiter but occurred as data
...tedesign/common/scripts/mmenuns4.js'><\/script>");
Is there any way to fix this?
Thanks
RWW
Poster: Ruth
Dated: Monday June 21 2004 - 3:37:43 BST
Yes, there's something about cdata being used. I have no idea what that is but I've read a few places on the forum where it had to be used to hide the script for whatever reason. Find Maz's name in a forum post then click her www button and check her website. Look at the source, you'll see how she uses it.
Ruth
Poster: Swetsenegger
Dated: Monday June 21 2004 - 20:18:17 BST
<script type="text/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>
Just add the 'comment' tags.
My site is XHTML 1.1 strict validated with this code.
Ow and remove <script language=JavaScript> and change it to <script type="text/javascript">. Don't forget to add the quotes for every value in XHTML.
Poster: Maz
Dated: Monday June 21 2004 - 22:22:33 BST
Hi,
You need CDATA tags, I added an example in the beginners section of the forum for getting started.
maz
Poster: tepidarium
Dated: Monday July 12 2004 - 19:26:41 BST
Maz wrote:
Hi,
You need CDATA tags, I added an example in the beginners section of the forum for getting started.
maz
You need CDATA tags, I added an example in the beginners section of the forum for getting started.
maz
I did a search for xhtml validation and found this thread. Looks interesting...so it only has to be placed around the javascript statemnt that refers to NN4?
BTW -what is CDATA?
Re: Page Validation
Poster: hatchywatchy
Dated: Tuesday April 29 2008 - 16:21:57 BST
Hi all,
It would require the code to look as follows:
Code:
<script 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>
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>
Let me know if it passes Validation.
Re: Page Validation
Poster: John
Dated: Tuesday April 29 2008 - 16:41:34 BST
Actually the calls were changed a long time ago (it's in the download file!)...
Code:
<script type="text/javascript" src="milonic_src.js"></script>
<noscript><a href="http://www.milonic.com/">JavaScript DHTML Menu Powered by Milonic</a></noscript>
<script type="text/javascript" src="mmenudom.js"></script>
<script type="text/javascript" src="menu_data.js"></script>
<noscript><a href="http://www.milonic.com/">JavaScript DHTML Menu Powered by Milonic</a></noscript>
<script type="text/javascript" src="mmenudom.js"></script>
<script type="text/javascript" src="menu_data.js"></script>