[Javascript] Delay before print???

Chris Nafziger CNafziger at sauder.com
Tue Oct 8 13:35:07 CDT 2002


First time I've every had to worry about printing in a pop-up window that
you want to close as soon as possible.

Code:

window.print();
for(i=0;i<100000;i++);
window.close();

With the loop in, the spool file is created and the doc prints fine.  If you
take the loop out, the window closes, and nothing prints.
Also tried using the onAfterPrint event - same thing happens (even though
the JSB says that event fires after the page is sent to the printer or
spooler..

How do you guys typically handle something like this?



More information about the Javascript mailing list