W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2005

[whatwg] [html5] onbeforeprint/onafterprint (was window.print() undefined)

From: Dean Edwards <dean@edwards.name>
Date: Wed, 20 Jul 2005 17:13:04 +0100
Message-ID: <42DE7810.5030500@edwards.name>

The big problem for me on this whole onbeforeprint/onafterprint argument 
is that I only have partial control of the DOM using JavaScript.

What do I mean by this?

I can create content using the window's load event:

onload = function() {
  // create content for screen
}

This content, which is not suitable for print, needs to be removed when 
the document is printed. I can even invoke the print method myself:

window.print();

I'm told I must use another language to remove the content. CSS you say. 
Doesn't that seem wrong? Why can't I do it with script? I created the 
content with script. Why can't I remove it the same way?

-dean
Received on Wednesday, 20 July 2005 09:13:04 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:42 UTC