I am having a problem with window.print in a popup window.
I am creating 2 popup windows both with a print button in them, 1
works the other doesn't. Code runs in a javascript function on a
webpage. Here is the difference :
First example (works) -
mywinman=window .open('t&cs.htm ','win2','toolb ar=no,location= no,directories= no,status=no,me nubar=no,scroll bars=yes,resiza ble=no,width=60 0,height=500,le ft=100,top=100' );
htm file contains this button -
<INPUT type='button' value='Print' OnClick='window .print()'>
Second example (no errors but nothing happens) -
mywin=window.op en('','win1','t oolbar=no,locat ion=no,director ies=no,status=n o,menubar=no,sc rollbars=yes,re sizable=no,widt h=550,height=60 0,left=50,top=5 0');
content created using document write in a loop as follows :
mywin.document. write(html_line [i]);
code is in the line eg.
html_line [idx] = "<INPUT type='button' value='Print'
OnClick='window .print()'>";
It seems that somehow I am not specifying the window correctly
although I have tried various combinations.
I am sure it is something stupid as usual. Thanks in advance.
John
I am creating 2 popup windows both with a print button in them, 1
works the other doesn't. Code runs in a javascript function on a
webpage. Here is the difference :
First example (works) -
mywinman=window .open('t&cs.htm ','win2','toolb ar=no,location= no,directories= no,status=no,me nubar=no,scroll bars=yes,resiza ble=no,width=60 0,height=500,le ft=100,top=100' );
htm file contains this button -
<INPUT type='button' value='Print' OnClick='window .print()'>
Second example (no errors but nothing happens) -
mywin=window.op en('','win1','t oolbar=no,locat ion=no,director ies=no,status=n o,menubar=no,sc rollbars=yes,re sizable=no,widt h=550,height=60 0,left=50,top=5 0');
content created using document write in a loop as follows :
mywin.document. write(html_line [i]);
code is in the line eg.
html_line [idx] = "<INPUT type='button' value='Print'
OnClick='window .print()'>";
It seems that somehow I am not specifying the window correctly
although I have tried various combinations.
I am sure it is something stupid as usual. Thanks in advance.
John
Comment