W3C home > Mailing lists > Public > www-validator@w3.org > April 2001

Script valid html, but not xhtml

From: Osmo Saarikumpu <sendosmo@hotmail.com>
Date: Fri, 06 Apr 2001 16:18:13
To: www-validator@w3.org
Message-ID: <LAW2-F146XKPl5GDrPi0000194a@hotmail.com>
This is a script that's a child of BODY and it validates as HTML 4 ok.

<script type="text/javascript">
clr=new Array('00','20','40','60','80','a0','c0','ff');
for (i=0;i<8;i++)
{ document.write('<table border="1" cellpadding="3" align="center">');
   for (j=0;j<8;j++)
    { document.write('<tr>');
      for (k=0;k<8;k++)
       document.write('<td bgcolor="#'+clr[i]+clr[j]+clr[k]+'"><tt><font 
color="#'+clr[7-i]+clr[7-j]+clr[7-k]+'">'+clr[i]+clr[j]+clr[k]+' 
<\/font><\/tt><\/td>');
      document.write('<\/tr>');
    };
   document.write('<\/table>');
};
</script>

But as soon as I attempt to validate it as XHTML 1 the response is: "element 
table not allowed here", and the same goes for the rest of the elements.

Is it a bug, or is it me (again)?

/os
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Received on Friday, 6 April 2001 12:18:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:55 GMT