473,320 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 7821
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
3
by: Marcus Bjorke | last post by:
I use a print link that causes a problem with Opera 7. The link looks like this <a href="javascript:parent.frames.mainFrame.print()">Print this page</a> I also used <a...
0
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust...
1
by: dibyendu_k | last post by:
Hi, There is a problem i cant solve regarding Internet Explorer 5.5. It is regarding the Print Dialog Box. From a webpage if I open a popup window (window.open()) containing buttons Print and...
0
by: Stewart Midwinter | last post by:
I have a Tkinter app running on cygwin. It includes a Test menu item that does nothing more than fetch a directory listing and display it in a Toplevel window (I'd use a tkMessageBox showinfo...
8
by: makunag | last post by:
Didn't get answer with google and in my regular forum. Came across this site and posting here. Your help will be highly appreciated ! Our application have frames - MainNav, TaskNave and Content....
2
by: =?Utf-8?B?aGVsZmk=?= | last post by:
Hi all, I have replied with my own questions to an older post entry but after a while I thought it's better to start a new thread based on the previous one. Perhaps with the new thread I will...
1
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.