How do Browsers render content..?
2 places to place the <scripts>
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.
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.
That case placement of the scripts wont' matter?
I mean in both ways all the script/s should be downloaded to the client, then parsed(DOM) and rendered on UI?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread