• Hello,

    still trying to figure out the best way how to defer parsing of JS.

    1) I have tried few plugins (ASync Java Script, Speed Booster Pack, WP Deferred Javascripts) – Unfortunately they cause rendering issues and my sites occasionally does not load completely.

    2) Also tried the manual code. Unfortunately, this has a conflict with the OceanWP theme and the metabox disappears when using this.

    function defer_parsing_of_js ( $url ) {
    if ( FALSE === strpos( $url, '.js' ) ) return $url;
    if ( strpos( $url, 'jquery.js' ) ) return $url;
    return "$url' defer ";
    }
    add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );

    3) Have found next article – maybe should I try this?

    https://technumero.com/defer-parsing-of-javascript/

    Someone with the better solution? Thank you!

    • This topic was modified 6 years, 1 month ago by micwie.
    • This topic was modified 6 years, 1 month ago by micwie.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    I replied to your previous topic about the same query. Please don’t create a duplicate topic.
    Try to use Async JavaScript plugin to fix it. Also, give a try to WP Rocket plugin and check it fixes it or not.

    Thread Starter micwie

    (@micwie)

    Ok. I am sorry for that! I thought that this is a slightly different topic. You can merge it, if you can. I am fine with this. Thank you and apologise again!

    Hello,

    Try to use a cache plugin with a CDN service. Maybe it can fix the issue.

    Thread Starter micwie

    (@micwie)

    I am already on CloudFare with W3 Total Cache. Looks like everything is working just fine on desktop, but the mobile version of the site behaves funny sometimes or does not load at all. I guess that I have to recheck every optimalization plugin again to examine where to problem lies.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Defer parsing of JS’ is closed to new replies.