Script Tag - Async & Defer

I have a couple of questions about the attributes async & defer for the <script> tag which to my understanding only work in HTML5 browsers.

One of my sites has two external JavaScript files that currently sit just above the </body> tag; the first is sourced from google and the second is a local external script.

With respects to site load speed

  1. Is there any advantage in adding async to the two scripts I have at the bottom of the page?

  2. Would there be any advantage in adding the async option to the two scripts and putting them at the top of the page in the <head>?

  3. Would this mean they download as the page loads?

  4. I assume this would cause delays for HTML4 browsers, but would it speed up page load for HTML5 browsers?

Using <script defer src=...

  1. Would loading the two scripts inside <head> with the attribute defer the same affect as having the scripts before </body>?
  2. Once again I assume this would slow up HTML4 browsers.
Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.