0

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
  • Not getting errors in FF or IE8. Commented Mar 6, 2010 at 2:10
  • I'm talking about if you validate the document through the W3C validator Commented Mar 6, 2010 at 2:11
  • Don't forget to accept the answer that worked for you. Just click the checkmark next to your chosen answer. Commented Mar 6, 2010 at 15:59

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Is that exactly how it's written?
That works, thanks. I'll research more on exactly what it does later on.
0

Yes your & need to be encoded to &amp;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.