• Hi everybody,
    I am trying to speed up my sites and came across “defer parsing javascript”.
    I read a lot about it and understand you can put a code in your funtions.php.
    I did that, in the child theme of my theme, but that didn’t work.
    This is the code I used:

    // Defer jQuery Parsing using HTML5’s defer property
    if (!(is_admin() )) {
    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 );
    }

    The admin part is to let texteditors in the admin work alright.
    But also without that part I see no difference in the gtmetrix score.
    I also tried the WP deferred javascripts plugin, but that didn’t solve it either.
    The defer parsing in Gtmetrix is still at 0.
    I also changed themes to the Twenty Eleven theme to see if it is theme related, but that didn’t solve it either.
    What am I missing here? Anybody has an idea?

    Johanna

  • The topic ‘Defer parsing javascript’ is closed to new replies.