On this page - I want you to notice that I never added a newline in my code.

All your rewrite information NEEDS to be on one line, not two (and inbetween the quotes). That's where you'll get your errors.

<SCRIPT LANGUAGE = "JavaScript">
function Rewrite()
{
document.write("<HTML>")
document.write("<HEAD>")
document.write("<TITLE>This page is newly written.</TITLE>")
document.write("</HEAD>")
document.write("<BODY>")
document.write("<CENTER>")
document.write("<H1>This page is newly written.</H1>")
document.write("We rewrote this page...")
document.write("<BR>")
document.write("Using the document.write() method, we ")
document.write("were able to rewrite this page on the fly. ")
document.write("<BR>")
document.write("The entire page has been rewritten.")
document.write("<CENTER>")
document.write("</BODY>")
document.write("</HTML>")
}
</SCRIPT>