This is not true in general. I assume you tried this in Chrome. Have you tried using Firefox? IE? before posting this?
In FF browser it still render the DOM and download the script in the background, thus it still show the content in the background. I tried it in IE10 as well, and it do the same with FF. But the bottom line is some browser executes and downloads JS when it encounters a <script>
tag in the structure.
To prevent executing script before the DOM is render you should wrap your script with something like:
$(document).ready(function(){
alert('Hello World');
});
You can read also here
But I'm not really sure what is the point of your question.
` being displayed immediately. Perhaps in css or script not shown but for that we have no way to even guess. Please provide a [mcve]
– charlietfl Jul 09 '17 at 23:50content is shown on Firefox. Any idea why Chrome is behaving this way.
– J. Silver Jul 10 '17 at 00:15