I have a web page with JavaScript that:
Uses
var win = window.open('', '_blank', '');
to create a new window
Uses
win.document.write(htmlString);
to build the new window's HTML. It contains a button with an "onClick" attribute of "window.print();".
When the new window's print button is clicked with IE6 (I haven't tested with other browsers), nothing happens - no error, but no Windows print dialog either.
I've added alerts to the "onClick" Javascript before and after the window.print statement to make sure that event is being triggered.
Software/Hardware used:
ASKED:
May 19, 2004 9:52 AM
UPDATED:
May 20, 2004 10:06 AM
I saw something about having to call the documents close method newWindow.document.close();
I added window.document.close(), and it works now.
Thanks, tmjimob!
Great! Lucky guess – I didn’t really think it would work, but glad it did