How to eliminate render-blocking JavaScript

I was testing the web page loading with Google PageSpeed tool. The result says “Eliminate render-blocking JavaScript and CSS in above-the-fold content” for

<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/jquery.js?ver=1.11.2'></script>
<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>

The source code is:

Read More
<head>
...
...

<script>(function(){document.documentElement.className='js'})();</script>
...
...
</head>

I’m keen to add a async or defer tag. How can I achieve this?

Related posts

1 comment

  1. From MDN about the async attribute:

    It has no effect on inline scripts (i.e., scripts that don’t have the src attribute).

    The same is true about the defer attribute.

    Basically, if you really want to get rid of the error, just move that to just before the </body> tag.

Comments are closed.