2 places to place the <scripts>
1) <header>
2) <body> (at the end)
If scripts are placed as in 1) Browsers might not load the rest of the document unless the whole of <script>'s loaded, as it might have some document changing stuff.
For a better performance, if all the heavy scripts are placed as in 2), enabling all the document content to load first, though the DOM is ready, even in this case Browsers have to load all the scripts right, before rendering the content?? (as script might have some document changing stuff.)
So does placement of the <script> tag really matter? Please clarify.
You want your libraries to first... put them in the HEAD.
examples...
Your content has an "onclick" event defined, if the user clicks it before the library with that function is loaded, you just caused an error.
Supposing your scenario where the library loads slowly and the page has some DOM manipulation that is supposed to happen when the page loads. Do you want the user to see the "base" content? Probably not... you are manipulating the DOM for a reason.
Bookmarks