Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > When do we need document.close()

Reply
Thread Tools

When do we need document.close()

 
 
howa
Guest
Posts: n/a
 
      12-09-2006

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

 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      12-09-2006
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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      12-09-2006
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to "shred" hardive..need software. Xeno Chauvin Computer Support 4 03-13-2005 01:26 PM
Need help with need to Force Garbage Collect John Java 1 08-19-2004 03:32 PM
Need help! I need to add lead zeros to a textbox Teep ASP .Net 2 06-21-2004 01:04 PM
Please help!!! Need datagrid selection to fill textboxes...Need quick!! TN Bella ASP .Net 1 06-18-2004 01:31 AM
Need to compare Photos to DVD software - Need Help? Bob Digital Photography 4 02-04-2004 02:13 AM



Advertisments