468,556 Members | 2,051 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,556 developers. It's quick & easy.

Problem with window.print

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,s crollbars=yes,resizable=no,width=600,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.open('','win1','toolbar=no,location=n o,directories=no,status=no,menubar=no,scrollbars=y es,resizable=no,width=550,height=600,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

Jul 20 '05 #1
1 7603
On Thu, 14 Aug 2003 21:41:26 +0000 (UTC), John <j@laycus.con> wrote:
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=n o,location=no,directories=no,status=no,menubar=no, scrollbars=yes,resizable=no,width=600,height=500,l eft=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 [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


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

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Bruce Davis | last post: by
3 posts views Thread by Marcus Bjorke | last post: by
reply views Thread by syed_saqib_ali | last post: by
reply views Thread by Stewart Midwinter | last post: by
2 posts views Thread by =?Utf-8?B?aGVsZmk=?= | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.