How to eliminate render-blocking JavaScript and CSS
-
Hi,
I have this:
Eliminate render-blocking JavaScript and CSS in above-the-fold content
Your page has 4 blocking script resources and 15 blocking CSS resources.https://ermagazin.com/…-includes/js/jquery/jquery.js?ver=1.11.3
https://ermagazin.com/…s/jquery/jquery-migrate.min.js?ver=1.2.1
https://ermagazin.com/…e-theme/js/owl.carousel.min.js?ver=4.4.2
https://ermagazin.com/…dmin-ajax.php?action=ot_dynamic_js&ver=1The solution for this I found at: https://varvy.com/pagespeed/defer-loading-javascript.html
Its a step how to defer loading of javascript
So I added this code in HTML before </body>
<script type="text/javascript"> function downloadJSAtOnload() { var element = document.createElement("script"); element.src = "defer.js"; document.body.appendChild(element); } if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; </script>
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
Just I need to replace this “defer.js” with a name of my external JS file.
But what is the name of my external file JS file?
My site is ermagazin.com
- The topic ‘How to eliminate render-blocking JavaScript and CSS’ is closed to new replies.