onafterprintEvent

事件对象参考手册Event Object

Examples

Execute JavaScript after printing the page:

<body onafterprint="myFunction()">

Try it yourself »


Definition and Usage

The onafterprint event is triggered after the page is printed, or when the print dialog has been closed.

Tip:The opposite event of the onafterprint event isonbeforeprintevent.


Browser Support

Event
onafterprint 63 Yes Yes Not supported Not supported


Syntax

In HTML:

<element onafterprint="myScript">Try it yourself

In JavaScript:

object.onafterprint=function(){myScript};Try it yourself

In JavaScript, using the addEventListener() method:

object.addEventListener("afterprint", myScript);Try it yourself

Note:Internet Explorer 8 and earlier IE versions do not supportaddEventListener()method.


Technical Details
Does it support bubbling: No
Can it be canceled: No
Event type: Event
Supported HTML tags:  <body>


事件对象参考手册Event Object Other Extensions