• Resolved matcat69

    (@matcat69)


    Would the following code be of any benefit in conjunction with autoptimize? Could it cause problems?
    Thanks
    /*

    // Defer Javascripts
    // Defer jQuery Parsing using the HTML5 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 “;
    return “$url’ defer onload='”;
    }
    add_filter( ‘clean_url’, ‘defer_parsing_of_js’, 11, 1 );
    }

    */

Viewing 1 replies (of 1 total)
  • Plugin Author Frank Goossens

    (@futtta)

    well, AO’ed JS (if not forced in head) is deferred already so most of this will be useless and the only JS impacted would be the excluded JS, but when you have to exclude JS from AO optimization in general it’s because it can’t be (aggregated and) deferred. so not sure if it’ll really help. but then again, the proof of the pudding is in the testing 😉

    frank

Viewing 1 replies (of 1 total)

The topic ‘Code conflict?’ is closed to new replies.