The html 5 semantics specification on the w3c site doesn’t make any distinction for the script tag whether in the head or body but browsers do behave differently for both cases.
Scripts are downloaded in parallel in the head, therefore there is a wonder to whether the execution of the code in the libraries is affected by the loading.
Btw, I am not talking about trying any DOM writing (not in head), but something that could be as simple as defining variables or classes (where a variable would be created in one JS library and used to create another one in another JS library for instance) That happens if you load a 3rd party library that defines elements that you use to declare your own elements in your own library.
the loading order can be
It seems that this is confirmed by adding alert statements in the JS files.
The order in which the alerts are popping up is the same as the order in which the files are declared, plus the alerts starts to appear only after the last file in the header is downloaded.
However my observations can be subjective, plus could not a guarantied behavior through all browsers unless this is understood to be the way they are meant to behave.
Does anybody have some insights on that?