Problem with window.print

J

John

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','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500,left=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.open('','win1','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=550,height=600,left=50,top=50');

content created using document write in a loop as follows :

mywin.document.write(html_line );

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
 
J

John

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','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500,left=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.open('','win1','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=550,height=600,left=50,top=50');

content created using document write in a loop as follows :

mywin.document.write(html_line );

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


BTW Just noticed it works fine with Netscape 7 but not IE6
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,113
Latest member
Vinay KumarNevatia
Top