Skip to content
Advertisement

Execute Commands after print window is closed

I’m printing a web page using the code below:

window.print();

I want to execute a few commands after the Print dialog is closed. How can I detect it?

Advertisement

Answer

window.onload = PrintMe;

function PrintMe() {
    window.print();

    alert("Closed Printing");


}
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement