Bravo Kernel
Tags
Home
Tags
Published on
January 22, 2011

How to fix Javascript ampersand breaking W3C validation

If your page doesn't pass W3C Validation because of Javascript containing:

  • Ampersands (&)
  • Greater/lesser than (< >)

Encapsulate your script inside a CDATA tag and the W3C parser will ignore it.

<script type="text/javascript">
	//<![CDATA[
		script here
	//]]>
</script>
Edit this Page on Github
← How to create Git patches
How to make a perfect Cosmopolitan →
githubtwitter
Bravo Kernel
•
© 2024
•
Bravo Kernel
Powered by Pliny!