Title: W3C Validation Throws Warnings on JavaScript
Last modified: December 29, 2019

---

# W3C Validation Throws Warnings on JavaScript

 *  Resolved [Fetch Designs](https://wordpress.org/support/users/fetchdesigns/)
 * (@fetchdesigns)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-throws-warnings-on-javascript/)
 * W3 Total Cache plugin is outputting invalid HTML5 that throws warnings when running
   through validator.w3.org. Specifically of note, the output of `<script type="
   text/javascript>` should be handled like the below modification which is based
   on WordPress core code…
 *     ```
       <?php $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/javascript"'; ?>
       <script<?php echo $type_attr; ?>>
       ```
   
 * The exact warning is…
 * > The `type` attribute is unnecessary for JavaScript resources.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-throws-warnings-on-javascript/#post-12279093)
 * Hello [@fetchdesigns](https://wordpress.org/support/users/fetchdesigns/)
 * Thank you for the information.
    Can you please share the exact snippet so we 
   can check this or paste the script w3tc generates with type? I can’t see any 
   in frontend. Thank you!
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-throws-warnings-on-javascript/#post-12296291)
 * No activity for a week.
    Marking topic as resolved.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘W3C Validation Throws Warnings on JavaScript’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [html5](https://wordpress.org/support/topic-tag/html5/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [validator](https://wordpress.org/support/topic-tag/validator/)

 * 2 replies
 * 2 participants
 * Last reply from: [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-throws-warnings-on-javascript/#post-12296291)
 * Status: resolved