I need a js code which will close window right after appearing of pop up print window. Here is my code:
P
This code worked for me:
print = function() {
var printContents = document.getElementById('div').innerHTML,
params = [
'height=' + screen.height,
'width=' + screen.width,
'fullscreen=yes'].join(','),
popup = window.open("", 'popUpWindow', params);
popup.document.write(''
+ printContents
+ '');
popup.onfocus = function () {
setTimeout(function () {
popup.focus();
popup.document.close();
}, 200);
};
};