Why is the validator trying to validate my javascript?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Why is the validator trying to validate my javascript?

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post 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.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post 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>
Post Reply