Page 1 of 1

Why is the validator trying to validate my javascript?

Posted: Wed Sep 13, 2006 2:39 pm
by Luke
The only errors I am getting are when it is trying to validate links that are in javascript... why?
http://validator.w3.org/check?uri=http% ... &verbose=1

Posted: Wed Sep 13, 2006 4:45 pm
by feyd
Probably because they are raw, exposed tags in the document. Stab in the dark: change the comment mark out to a CDATA section.

Posted: Thu Sep 14, 2006 4:14 pm
by ok
You need to replace all "</" (in JavaScript strings) to "<\/".

If you use "HTML validator (tidy)" in FF, you can see what is the problem.

Posted: Thu Sep 14, 2006 4:26 pm
by nickvd
feyd wrote:Probably because they are raw, exposed tags in the document. Stab in the dark: change the comment mark out to a CDATA section.

Code: Select all

<script type="text/javascript">//<![CDATA[ 

//js code goes here
  
//]]></script>