• TouchTheCow

    (@touchthecow)


    This is what I have entered just before the /body tag in the footer php. I’m using Hueman theme (child theme). Google page speed still reports this as a problem so it hasn’t been addressed. What am I doing wrong? I’ve tried with and without the version number.

    <script type="text/javascript">
    function downloadJSAtOnload() {
    var element = document.createElement("script");
    element.src = "/public_html/wp-includes/js/jquery/jquery-migrate.min.js;
    document.body.appendChild(element);
    }
    if (window.addEventListener)
    window.addEventListener("load", downloadJSAtOnload, false);
    else if (window.attachEvent)
    window.attachEvent("onload", downloadJSAtOnload);
    else window.onload = downloadJSAtOnload;
    </script>
Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Have you reviewed Using_Javascript and wp_enqueue_script()?

    Thread Starter TouchTheCow

    (@touchthecow)

    Thank-you I will try that though at a glance it may be above my head as yet.

    Thread Starter TouchTheCow

    (@touchthecow)

    Arg. I’m lost. From what I can gather, the suggestion is that I should call the js from the header but moving it to the footer is what I was trying to do as per Google. The enqueue thing is over my head at the moment for sure. I tried to use W3 Total Cache to handle as many of these issues as possible but it prevented my theme from reading from the child theme for some reasos.

    Thread Starter TouchTheCow

    (@touchthecow)

    I’m out of my depth. Going to try W3 Total Cache again.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Trying to remove render blocking JS above the fold #fail’ is closed to new replies.