views:

23

answers:

2

So, I read the W3C validation FAQ about why some javascript causes validation errors but didn't seem to find an answer regarding my problem.

If you try to validate http://www.proskimboarding.com/codingtest/Public/registration.php

you'll receive a bunch of errors within the javascript code... anyone know of a solution for this? (mainly involving ampersands)

+3  A: 

Your ampersands need to be & instead of just & when outside of javascript, inside javascript you need to use this style with your script tags:

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

alert("My Code here");

//]]>
</script>

Update: Tested this with your code, it solves 12/13 errors, the last is just not having a character encoding specified in the file, which is minor.

Nick Craver
Is that exactly how it's written?
Richard Harrington
@Richard -Yep, here's your file updated: http://pastie.org/856764
Nick Craver
That works, thanks. I'll research more on exactly what it does later on.
Richard Harrington
@Richard - Here ya go: http://www.w3.org/TR/xhtml1/diffs.html#h-4.8
Nick Craver
A: 

Yes your & need to be encoded to &amp;

Dustin Laine