0

It was common suggestion years ago to prefer putting JavaScript into the footer of the page body to avoid blocking the rendering that happens if JavaScript is in the page head.

Now with async and defer script tag does it really matter where the JavaScript is?

Vad1mo
  • 5,156
  • 6
  • 36
  • 65
  • Yes, it matters. A deferred script at the end of `body` is not useful, put that in `head` to take the advantage of `defer` attribute. – Teemu Sep 17 '20 at 13:53
  • i would think not as the asyn and defer dom elements would be delayed in being seen if they are at the end of the document. It is worth noting, many browsers limit the number of concurrent connections - I think chrome restricts to 6 - so try to use as few bundles as possible to speed up load time – developer Sep 17 '20 at 13:55

0 Answers0