I need a js code which will close window right after appearing of pop up print window. Here is my code:
<a href="javascript:;" onclick="print()">Print</a>
function print()
{
win = window.open();
win.document.write('<html><head>blablabla.......');
win.window.print();
win.window.close();
}
But it doesn't work because window closes before it pop up.