Mobile app version of vmapp.org
Login or Join
Frith620

: Google Optimizer code, validation and cdata I ran my site through the W3C validator, and a bunch of errors were caused by the Google Website Optimizer javascript. It seems weird that would happen.

@Frith620

Posted in: #Google #GoogleSearchConsole #Validation

I ran my site through the W3C validator, and a bunch of errors were caused by the Google Website Optimizer javascript.

It seems weird that would happen. If I put CDATA around it, the error go away. I assume that the code will still work?

So, I'm wondering if there's ever a time it's bad to put CDATA around javascript?
and
Why would Google's javascript snippets not validate in the first place?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Frith620

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kristi941

It probably has to do with the doctype. I suspect you're using XHTML. JavaScript Contains Characters Which Can Not Exist in XHTML. Raw < and & characters are not allowed except inside of CDATA Sections. See this page for more.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme