Posted on Leave a comment

Validating script elements in XHTML

I’ve found that multiple errors will come from within any [script] tags that I have. To solve this, use
CDATA as so:

[script]
< ! [ CDATA [

** Please note that you should not have your
characters spaced as I've done above, this is
because my blogger editor doesn't
like angle brackets!!

function thisDoesntMatter(a,b)
{
if (a < b && a < 0) then { return 1 } } ]]>

Above is the closing tag for your CDATA

[/script]

On another note, if you are having issues with chacters within links being validated, make sure your & signs are using the ASCII code and not just the & symbol.