Printing from parent window in OnLoad event

A

alex

I am opening a new popup window, and i want to print the popup's window
contents.

The window is opened correctly, and the print dialog opens. But in
firefox (haven't tried IE yet), i get a message telling me that the page
has changed it's contents when i push the 'print' button and the page
doesn't get printed (i have to do it manually from the file->print menu).

It's like the document was not fully loaded when the print dialog showed
up, but the function should be called when the onLoad event triggers, so
it should not have changed!

This is my function:

function callPrint () {
dialogWin.url="print.php";
dialogWin.name="printWin";
dialogWin.win=window.open(dialogWin.url,dialogWin.name);
dialogWin.win.onload=new function() {
dialogWin.win.print();
};
}


BTW i tried 'onload' and 'onLoad' to test if the case mattered.

Thanks in advance
alex.
 

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,780
Messages
2,569,611
Members
45,281
Latest member
Pedroaciny

Latest Threads

Top