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

Problem with W3C Validation


Poster: andigwandi
Dated: Wednesday December 31 2008 - 6:18:13 GMT

Hi

I am using milonic and I am having a problem. The following code is giving error with W3C when I am validating my page:

-------------------------------
<script type="text/javascript">
if(ns4)_d.write("<script src=script/mmenuns4.js type=text/javascript><\/script>");
else _d.write("<script src=script/mmenudom.js type=text/javascript><\/script>");
</script>
-------------------------------

I am using Visual Studio 2008.

Waiting for reply with solution and Thanks for you help in advance.

Re: Problem with W3C Validation


Poster: Ruth
Dated: Wednesday December 31 2008 - 17:29:46 GMT

Hi,

I believe you're going to need cdata tags for the call for those files.

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


If you do NOT need to support NS4, and there aren't many who use that browser anymore, then you can fix the problem by leaving out the if statement and just calling the mmenudom.js file. Given that NS4 is over 12 years old I believe, unless you have a really specialized audience, i.e. some less technical developed countries may have it, there is really no reason to support it.

Code:
<script type="text/javascript" src="milonic_src.js"></script>   
<script type="text/javascript" src="mmenudom.js"></script>
<script type="text/javascript" src="your_data_file_name.js"></script>   


Ruth