There is a page for printing, before printing, I hide part of the elements, and part of it shows (using css);
After printing, this tab should close; I set the event handler <body onafterprint="self.close();">
to close only when I select print from the menu, and when I call window.print()
in the code it does not close if I onafterprint
event onafterprint
to a separate function and I put the alert("...")
before closing the window, the alert
is displayed and after clicking on OK, the tab still does not close (I was in Chrome, Opera, FireFox
). Tell me, please, what could be wrong?