• Resolved Fropky

    (@fropki)


    Hi,

    When i try to validate html I get this error. Should I Ignore

    Error: Element style not allowed as child of element noscript in this context. (Suppressing further errors from this subtree.)
    From line 403, column 11; to line 403, column 17
    <noscript><style>.lazyl
    Contexts in which element style may be used:
    Where metadata content is expected.
    In a noscript element that is a child of a head element.
    Content model for element noscript:
    When scripting is disabled, in a head element: in any order, zero or more link elements, zero or more style elements, and zero or more meta elements.
    When scripting is disabled, not in a head element: transparent, but there must be no noscript element descendants.
    Otherwise: text that conforms to the requirements given in the prose.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    I would ignore that, yes, but if you really want then search this forum because a workaround for this was provided already (a code snippet hooking into Autoptimize’s API to remove those offending elements).

    hope this helps,
    frank

    Thread Starter Fropky

    (@fropki)

    add_filter('autoptimize_filter_imgopt_lazyload_cssoutput','no_noscript');
    function no_noscript() {
        return '<style>.lazyload,.lazyloading{opacity:0;}.lazyloaded{opacity:1;transition:opacity 300ms;}</style>';
    }

    So does this code completely shuts lazy loading in case javascript not present? (Just thinking from search bot perspective)

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you can update the code to return ''; as the CSS in the return in fact has been removed from AO.

    what happens in case no JS is executed if you do that is that there will be an both an empty image placeholder and the original image (from the noscript-tag). what the bots might think if that I don’t know really … ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Lazy loading & HTML Validation’ is closed to new replies.