+ 2

Script Location within HTML

In this example, the script is located in the head. Would this cause functionality issues since it’s not located at the end of the body? With the way it’s set up now, my understanding is that elements on the page won’t be loaded before the script is run.

9th Dec 2017, 3:38 PM
Céleste Robinson
Céleste Robinson - avatar
1 ответ
+ 6
Well, if the script loads before the document, if it involves getting some elements, then yes. Else, no.
9th Dec 2017, 3:40 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar