Skip to content

why can’t i set window.onload in IE8?

I have the following function, which works fine in Firefox, but will do nothing in IE8

function print(url) {
    var w =;
    w.onload = function() {

I want to open a webpage and immediately open the print dialogue.


If you have the hand on the page at url, place the call there. In the HTML, at the end of the BODY tag. Add a SCRIPT tag with your call