HighDots Forums  

Printing from parent window in OnLoad event

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Printing from parent window in OnLoad event in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
alex bazan
 
Posts: n/a

Default Printing from parent window in OnLoad event - 12-20-2005 , 11:09 AM






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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.