1. The page will not be overwritten:
If it's just a JS statement: Document.writeln (' <span id=\ ' span1\ ' > Well, Hello </span> ');
Ps:\ ' is an escape character, representing '
2. Overlay page
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>Document</title>
<body>
<p> Hello. Window.writeln</p>
<script>
Document.writeln (' <span id=\ ' span1\ ' > Well, Hello </span> ');
document.write (' 123 ');
Window.onload=function () {
Document.writeln (' <span id=\ ' span1\ ' > Well, Hello </span> ');
}
</script>
</body>
Effect:
My understanding of why it is covered:
1. Before, it is always loaded and written to the page content. When the load is finished, the document flow is closed.
2. When the load is complete, the Window.onload event is triggered. In the example, the onload binding function has: document.write (* * * *) statement, which will let the document flow open again "PS: is a method called open (), the method will empty the current document content, and then write. After writing the Close method, the document flow closed ", so there will be a cover phenomenon
Document.Write Coverage Issues