Title: Fix For Invalid HTML? &#8211; JavaScript Needs To Be In CDATA
Last modified: August 21, 2016

---

# Fix For Invalid HTML? – JavaScript Needs To Be In CDATA

 *  [war59312](https://wordpress.org/support/users/war59312/)
 * (@war59312)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/fix-for-invalid-html-javascript-needs-to-be-in-cdata/)
 * Hi,
 * Anyone have a fix for the invalid HTML generated?
 * See report @ [http://validator.w3.org/check?uri=https://www.war59312.com/archives/2006/05/25/windows_vista_beta_2/](http://validator.w3.org/check?uri=https://www.war59312.com/archives/2006/05/25/windows_vista_beta_2/)
 * I know the fix is simple, have to wrap the javascript code in CDATA, like below:
 *     ```
       <script type='text/javascript'>
       /* <![CDATA[ */
       dataHere
       /* ]]> */
       </script>
       ```
   
 * I simply don’t see atm where the script is being generated.
 * Thanks,
 * Will
 * [https://wordpress.org/plugins/wordfence/](https://wordpress.org/plugins/wordfence/)

The topic ‘Fix For Invalid HTML? – JavaScript Needs To Be In CDATA’ is closed to
new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [cdata](https://wordpress.org/support/topic-tag/cdata/)
 * [html](https://wordpress.org/support/topic-tag/html/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [W3C](https://wordpress.org/support/topic-tag/w3c/)

 * 0 replies
 * 1 participant
 * Last reply from: [war59312](https://wordpress.org/support/users/war59312/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/fix-for-invalid-html-javascript-needs-to-be-in-cdata/)
 * Status: not resolved