Hey folks- I need to set the onload attribute for a newly popped-up window. The following code works for Firefox:
<a onclick="printwindow=window.open('www.google.com');printwindow.document.body.onload=self.print();return false;" href='www.google.com'>
However, when I try this in IE, I get an error - "printwindow.document.body null or not defined'
The goal is to pop open a new window, and call up the print dialog for that window once it's been opened.
Any clues on how to make this work? It is important not to use javascript elsewhere on the target page, as I do not have control over it. All functionality must be contained in the link I posted above.