lazy load breaks html validation Element script must not have attribute defer
-
When enabling lazy load images in LSCache it generates code at the end of the HTML body. It generates the following opening tag for the javascript tag:
<script data-no-optimize=”1″ defer>….</script>
When you put that piece of code through W3 validator it says:
“Error: Element script must not have attribute defer unless attribute src is also specified.”
I am not sure why this in-line javascript has the defer boolean, but if it is not needed it should be removed to have web pages pass html validation.
Code generating this nopn-valid tag is in
./src/media.cls.phpat the end of private function _finalize().
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘lazy load breaks html validation Element script must not have attribute defer’ is closed to new replies.