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:55
HTML Validation fails when using standard Java Scripts
Poster: CTT
Dated: Monday January 31 2005 - 8:17:15 GMT
When I try to validate the HTML on my page using the W3C HTML validator at http://validator.w3.org/, I get two failures with the following results:
Failure 1:
Line 19, column 73: delimiter """ invalid: only S separators and TAGC allowed here ...pt language=JavaScript src=mmenuns4.js></scr"+"ipt>");
Failure 2:
Line 19, column 73: end tag for element "SCR" which is not open
...pt language=JavaScript src=mmenuns4.js></scr"+"ipt>");
My code is straight from the download:
[code]<script language=JavaScript 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>[/code]
Any suggestions?
Thanks,
Poster: John
Dated: Monday January 31 2005 - 14:08:55 GMT
Exactly what version are you running?
The code included in the latest install.txt looks like this...
Code:
<script language="javascript" src="milonic_src.js"></script>
<script language="javascript" 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>
<script language="javascript" 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>
I added the type= parameter, but I think you'll find the problem is the missing comment tags.
Poster: CTT
Dated: Tuesday February 1 2005 - 3:20:02 GMT
I was working from a download of 5.691.
I just downloaded the file from the hyperlink named "Horizontal Navigational Menu in .zip format" version of 5.691 again to be sure. Here's what I find in menu.htm:
<script type="text/javascript" src="milonic_src.js"></script>
<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>
<script type="text/javascript" src="menu_data.js"></script>
No comment tags that I can see.
However, I've gotten my script to validate now. I was careless with the "" inside the script commands.
I find that the script now validates both with and without the Comment tags:
This validates without the comment tags:
<SCRIPT language="JavaScript" src="milonic_src.js" type="text/javascript"></SCRIPT>
<script language="JavaScript" 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>
<SCRIPT language="JavaScript" src="http://www.uuss.org/menu_dataintable.js" type="text/javascript"></SCRIPT>
and the script with the comment tags also validates:
<SCRIPT language="JavaScript" src="milonic_src.js" type="text/javascript"></SCRIPT>
<script language="JavaScript" 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>
<SCRIPT language="JavaScript" src="http://www.uuss.org/menu_dataintable.js" type="text/javascript"></SCRIPT>
Thanks for the help.