I have the following js script referenced on the bottom of the page:
<script src="http://example.com/test.js" type="text/javascript"></script>
Google PageSpeed suggestion is to defer the loading of this js. I don't quite understand how to do that or the repercussions. Can someone please explain?
defer
is only compatible with newer browsers, and I think only helps if the script is declared in the<head>
. However, if it is moved and the browser doesn't knowdefer
, then it will mess up execution by running too early. – Tinker