markdown guide

write() will do what you described as noted at the top of the documentation for the method which is found here: developer.mozilla.org/en-US/docs/W...

"[C]alling document.write on a closed (loaded) document automatically calls document.open, which will clear the document."

I'm also curious to know what it is you are trying to do. Maybe append() is what you're looking for.


This message appears Uncaught DOMException: Failed to execute 'append' on 'Document': Nodes of type '#text' may not be inserted inside nodes of type '#document'.


You would probably be better served to explain what you're trying to do; what problem you're trying to solve. Your pastebin code isn't valid JS, you can't open a window and inject a script on that window (for obvious security reasons). Also, try posting at stackoverflow.com/ as it's more specialized for code help like this.