B
Beni Rose
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(loc)
{
var printWin = window.open(loc+'?
dl=false','printpage','width=600,height=800,location=no,menubar=no,directories=no,status=no,toolbar=no,scrollbars=yes,resizable=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(loc)
{
var printWin = window.open(loc+'?
dl=false','printpage','width=600,height=800,location=no,menubar=no,directories=no,status=no,toolbar=no,scrollbars=yes,resizable=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.