in Tryit Editor v3.6 (w3schools.com) (the URL in the link is different than the following one) the statment "document.write" is called by an event and it behaves in a different way than in Tryit Editor v3.6 (w3schools.com) (different URL than previous).
In the first test the statement impacts the whole document while in the second one the tag SCRIPT put the statement in the flow, insulating it inside an element of the object DOCUMENT
I have anderstood the difference, but...
... does anyone be able to sketch the proper sequence of the document elaboration in both cases to explain what produces the difference?
THanks in advance