Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter hmwind

    (@hmwind)

    By the way, the document write trick is mentioned here:
    https://jamesingham.me/blog/google-plusone-w3c-valid

    Hi Hans,

    Thanks for pointing that out. I’ll need to do some research on this as the document.write trick won’t work in this context. The PHP script invokes the JavaScript function with parameters, and it is those parameters being picked up by the validator. It doesn’t like me using HTML inside those parameters. Looks like there is a small semantic error on the declaration of a span though so I’ll be able to fix that easy enough.

    I’ll keep you posted.
    Richard

    Hi, very simple fix, there’s a minor semantic error in the span code but the main issue was that I’d missed the CDATA wrappers as indicated here:

    <script type="text/javascript">
    //<![CDATA[
       jQuery(document).ready(function() { ...etc...
    //]]>
    </script>

    This is pretty minor though, for anybody else reading this thread – please wait for the next release to include this fix ??

    Hans, I know your theme is very customised so you may want/need to go ahead and manually edit the cookielawinfo_inject_cli_script() function (in functions.php). To fix the semantic error you should edit line 89 to be:

    <span id="cookie_hdr_showagain">

    (was a typo in it: <span=”#” …)

    I’ve tested this in the w3 validator and it passes.

    Thread Starter hmwind

    (@hmwind)

    That is the solution indeed, Richard!

    Thanks a lot for the very quick fix.

    I adapted the code and it validates perfectly in W3C now!

    Version 1.0.2 fixes this for all users.

    Hans, you’ll need to do some extra testing as upgrading the plugin may well overwrite some of the theme changes you made to get your custom setup working.

    ??

    Thread Starter hmwind

    (@hmwind)

    Richard, In the meantime I modified my theme and the new plugin version now runs (and updates) without further manual modifications from my side.

    Update done without problems. Thanks!

    Great job Hans

    You’re welcome
    Richard

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Cookie Law Info] W3C validation’ is closed to new replies.