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

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