On Tue, 24 Feb 2015 00:09:21 +0000 (UTC), Denis McMahon wrote:
> On Tue, 24 Feb 2015 00:09:41 +0100, Tony Johansson wrote:
>
>> Just assume that I have a very simple script tag that looks like this
>> <script>
>> document.write("This is a test");
>> </script>
>
>> Then is it just the equivalent if I put this script tag within header
>> tag or within the body tag.
>
> No.
>
> This particular script element will write the text "This is a test" into
> the document at the point you insert the script tag.
And then be moved into the document body if the script element is within the
document head. Interestingly, how this is exactly done, varies accross
different browser engines.