470,636 Members | 1,526 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

When do we need document.close()


Should we add document.close after each time when we used
document.write() ?

Dec 9 '06 #1
2 1643
ASM
howa a écrit :
Should we add document.close after each time when we used
document.write() ?
All depends if you want to add some more writing later or not

But all long document isn't closed browser continues to work and to use CPU

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 9 '06 #2
howa wrote:
Should we add document.close after each time when we used
document.write() ?
No, while the document loads you can use document.write() with calling
close yourself. However if you use document.write() after the document
has been loaded completely it implictly does a document.open() to
overwrite the loaded document and then your code has to do
document.close() once you are finished writing the new document (which
can be after several document.write() calls).
--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by timmy_dale12 | last post: by
1 post views Thread by D2CAD | last post: by
1 post views Thread by Display Name | last post: by
6 posts views Thread by mike | last post: by
2 posts views Thread by Jackson Yap | last post: by
9 posts views Thread by newbiegalore | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.