View Full Version : document write (JS)

01-20-2011, 09:39 PM
How can I print a string, on html document, on the current window?

when I use:


it opens a new page, and I want it to be desplayed in the body of the current window.

Thanks :)

01-21-2011, 06:21 AM
In order to avoid that, the document.write() method may only be employed as the page is being parsed (loaded).

You can use an element's innerHTML property to write to an element. That's actually non-standard. But it's used so much that it's widely supported.