W3C home > Mailing lists > Public > www-validator@w3.org > March 2003

Validator trying to validate javascript as HTML

From: Torben V. Rudgaard <torben@jubii.dk>
Date: Thu, 20 Mar 2003 02:10:59 +0100
Message-ID: <52D05AEFB0D95C4BAD179A054A54CDEB069F148F@mailsrv1.jubii.dk>
To: "'www-validator@w3.org'" <www-validator@w3.org>
The script on my page looks something like this:
 
<script language="javascript" type="text/javascript"> 
  function addOption(targetElement,value){
    for(var a=0 ; a<targetElement.length ; a++){
      if( targetElement[a].text == value) value = '-'
    }
    for(var a=targetElement.length;a!=0;a--){
      if( targetElement[a-1].selected)targetElement.remove(a-1)
    }
</script>

Validator thinks that because I use a "<" then its a HTML element.
 
<targetElement.length is not a valid element etc...
 
Ok ok ok..., I will put comments around the code then
 
<!-- 
  same script code
-->
 
Now it thinks that my "a--" in the script code ends the comment tag???
 
ehm.... hehe...
Any ideas ?
 


 Torben Rudgaard
 Chat, Classmates, Campaigns
 Office: +45 3327 9072
 Mobile:+45 2674 3555
 E-mail:   torben@Jubii.dk <mailto:torben@Jubii.dk>  	
 
Received on Wednesday, 19 March 2003 20:13:00 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 8 December 2021 15:25:47 UTC