Defer parsing of JS
-
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!
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Defer parsing of JS’ is closed to new replies.