Does anyone know how to Eliminate render-blocking JavaScript and CSS in above-the-fold content
Does anyone know how to Eliminate render-blocking JavaScript and CSS in above-the-fold content
Want to highlight a helpful answer? Upvote!
Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >
Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >
Does anyone know how to Eliminate render-blocking JavaScript and CSS in above-the-fold content
Read this :
https://developers.google.com/speed/docs/insights/BlockingJS
Make JavaScript Asynchronous
By default JavaScript blocks DOM construction and thus delays the time to first render. To prevent JavaScript from blocking the parser we recommend using the HTML
async
attribute on external scripts. For example:<script async src="my.js">
See Parser Blocking vs. Asynchronous JavaScript to learn more about asynchronous scripts. Note that asynchronous scripts are not guaranteed to execute in specified order and should not use
document.write
. Scripts that depend on execution order or need to access or modify the DOM or CSSOM of the page may need to be rewritten to account for these constraints.------------
To do that in iWeb, open the published webpages and add async to each javascript link at the top of the code :
<script type="text/javascript" async src="Scripts/iWebSite.js"></script>
<script type="text/javascript" async src="Scripts/Widgets/SharedResources/WidgetCommon.js"></script>
<script type="text/javascript" async src="Scripts/Widgets/PHPInclude/Paste.js"></script>
<script type="text/javascript" async src="Scripts/iWebImage.js"></script>
<script type="text/javascript" async src="Home_files/Home.js"></script>
Most likely you're posting the question in the wrong forum, but with or without iWeb you now know what to do.
Thank you Wyodor for your super fast response.
I've tried:
Changing the code so that it reads.
<script type="text/javascript" async src="Scripts/iWebSite.js"></script>
(for example) rather than just
text/javascript
in the corresponding scripts
Ive tried adding
<script type="text/javascript" async src="Scripts/iWebSite.js"></script>
as a code to the TOP of each corresponding script
I've tried adding
<script type="text/javascript" async src="Scripts/iWebSite.js"></script>
<script type="text/javascript" async src="Scripts/Widgets/SharedResources/WidgetCommon.js"></script>
<script type="text/javascript" async src="Scripts/Widgets/PHPInclude/Paste.js"></script>
<script type="text/javascript" async src="Scripts/iWebImage.js"></script>
<script type="text/javascript" async src="Home_files/Home.js"></script>
to the top of all .js scripts
and to a couple of lines down after the initial page introduction.
in vain I've also tried adding the same as head code and footer code.
But Ive obviously not got it right as yet, as no change from google page speed insights.
If you have time could you please further advise?
Sorry for being a bit of a numpty!
Kinds regards, Andy
FYI I'm using iWeb to create and iWeb SEOtool to publish
What you want, and what Google describes, cannot be done in iWeb.
So you have to do it after publishing the pages.
iWeb SEOTool has a forum :
http://www.ragesw.com/forums/index.php?/forum/22-seo-software-discussions/
Thank you
Does anyone know how to Eliminate render-blocking JavaScript and CSS in above-the-fold content