I'm trying to open a new window using window.open and then print that
window once it's loaded. It works fine in Firefox, but not at all in
IE. No matter what I put in my onload, it gets ignored. Here's the
code:
function openPrintPage(l oc)
{
var printWin = window.open(loc +'?
dl=false','prin tpage','width=6 00,height=800,l ocation=no,menu bar=no,director ies=no,status=n o,toolbar=no,sc rollbars=yes,re sizable=yes');
printWin.onload = function()
{
printWin.print( );
}
}
Even if I just put an alert in that printWin.onload , it doesn't do
anything. My only guess is that the page has loaded before the onload
function gets assigned, but I can't figure out a way to assign it
otherwise.
window once it's loaded. It works fine in Firefox, but not at all in
IE. No matter what I put in my onload, it gets ignored. Here's the
code:
function openPrintPage(l oc)
{
var printWin = window.open(loc +'?
dl=false','prin tpage','width=6 00,height=800,l ocation=no,menu bar=no,director ies=no,status=n o,toolbar=no,sc rollbars=yes,re sizable=yes');
printWin.onload = function()
{
printWin.print( );
}
}
Even if I just put an alert in that printWin.onload , it doesn't do
anything. My only guess is that the page has loaded before the onload
function gets assigned, but I can't figure out a way to assign it
otherwise.
Comment