Problem with window.print

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    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','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

  • John

    #2
    Re: Problem with window.print

    On Thu, 14 Aug 2003 21:41:26 +0000 (UTC), John <j@laycus.con > wrote:
    [color=blue]
    >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=windo w.open('t&cs.ht m','win2','tool bar=no,location =no,directories =no,status=no,m enubar=no,scrol lbars=yes,resiz able=no,width=6 00,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.o pen('','win1',' toolbar=no,loca tion=no,directo ries=no,status= no,menubar=no,s crollbars=yes,r esizable=no,wid th=550,height=6 00,left=50,top= 50');
    >
    >content created using document write in a loop as follows :
    >
    >mywin.document .write(html_lin e [i]);
    >
    >code is in the line eg.
    >html_line [idx] = "<INPUT type='button' value='Print'
    >OnClick='windo w.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[/color]

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

    Comment

    Working...