I did open a topic on this a while ago but looks like I cant reply to it for some reason. I noticed cornerstone js (one of them) is 124kb. I would like to defer it. I found this script while searching online and I would like to know if it will defer it.
/* Defer Parsing of Javascript*/
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 );
I would rather just defer cornerstone, the cs-body.js. A better option would be to get it to load from the footer and not from the header. I am using a plugin to get everything from the footer but all of cornerstone js files are still loading in the header.