[Javascript] window.print() problems on Mac

Esther_Strom at hmco.com Esther_Strom at hmco.com
Fri Oct 19 15:32:14 CDT 2001


I'm using a window.print() function in the onLoad of a form (I know,
generally it's rude and obnoxious to force printing, but this is an
intranet application and there are reasons for it, so no lecture please!)

It works just fine in NS and IE on the PC, and in IE on the Mac. But in
Netscape on the Mac, it seems to be stuck in some kind of loop - it brings
up the print dialog, you click OK, it prints, then brings up the print
dialog again. You can hit cancel at this point and have it go away, but I'm
curious as to why it's doing it in the first place. Does NS on the Mac
reload a document after it's printed, thereby forcing this particular
function into an endless loop?

Here's the code:

function runPrint(){
     if (document.forms[0].ErrorText.value ==""){
     window.print();
     }
}

As I said, it's called in onLoad. Thanks for any insight you can provide.

~Esther




More information about the Javascript mailing list