W3C Validation Throws Warnings on Javascript Tags
-
When trying to run through the W3C validator at validator.w3.org your plugin is throwing warnings on the instances of
<script type="text/javascript">due to that not being properly formatted for HTML5 since the type attribute is redundant. The specific warning is…The
typeattribute is unnecessary for JavaScript resources.You should update all instances of…
<script type="text/javascript">… with the following which matches core WordPress logic…
<?php $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/javascript"'; ?> <script<?php echo $type_attr; ?>>
The topic ‘W3C Validation Throws Warnings on Javascript Tags’ is closed to new replies.