0

Chrome is reporting the following when I run an audit with the chrome inspector:

7 inline script blocks were found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource.

The 7 scripts are at the very end of the head element. So is the "another resource" that it's referring to in the body?

If I move these 7 scripts to the beginning of the body the audit stops complaining.

Does moving them to the body tag improve performance?

Is there further documentation on this?

PS I see that there was a duplicate question listed for this. However I believe my issue is different since I eliminated the possibility of interference from extensions by using an incognito window.

zudduz
  • 2,457
  • 5
  • 24
  • 29
  • [Related](http://stackoverflow.com/questions/143486/unobtrusive-javascript-script-at-the-top-or-the-bottom-of-the-html-code) – William Barbosa May 14 '15 at 18:20
  • 1
    having the scripts in the head means that the browser has to stop and parse those scripts before continuing on to parsing the rest of your page. Essentially you are stalling your page by having them there. It is general best practice to include scripts at the end of the body. – BillPull May 14 '15 at 18:23
  • It has to parse both internal and external js? – zudduz May 14 '15 at 18:24
  • 1
    Yes that is correct. And when you have external script you have a penalty from the request. External script needs to be fetched, than parsed and then executed. Ideally you script should be at the end of the body element or have `async` attribute if load order is not essential. That way you will not block the DOM construction. – Blago Eres May 14 '15 at 18:43
  • @Paulie_D Can you please explain why my edit was insufficient to prevent being declared a duplicate? – zudduz May 14 '15 at 23:21
  • @Ted Hopp Can you please explain why my edit was insufficient to prevent being declared a duplicate? – zudduz May 14 '15 at 23:21

0 Answers0