Re: W3C and java

by "Bert Doorn" <bdoorn(at)iinet.net.au>

 Date:  Thu, 20 Jul 2000 21:28:30 +0800
 To:  <hwg-basics(at)hwg.org>
 References:  prairienorth
  todo: View Thread, Original
G'day

> If I have a page with javascript on it, it does not get w3c validated;
> but if it is removed it does validate. Why is that?

Probably because there's something "wrong" with the coding for the javascript.

The two most common problems are:

A) Using SCRIPT LANGUAGE="Javascript" instead of SCRIPT TYPE="text/javascript"

B) The script may have HTML embedded within "document.write" statements.  This
can cause problems to the W3C validator, particularly with closing tags.  For
instance, the validator does not read a TD inside the script but sees the
closing /TD.   Easy to fix - put a backslash \ in front of the forwasd slash
/.  Example:  document.write("<\/TD>")  (That's \ / , not the letter V

Hope this helps
--
Bert Doorn, Web Developer
http://www.BetterWebDesign.com.au/
and http://www.bwdzine.com/

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA