Window.onafterprint

  • Revision slug: DOM/window.onafterprint
  • Revision title: window.onafterprint
  • Revision id: 325075
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment

Revision Content

{{DomRef}}

Summary

The onafterprint property sets and returns the onafterprint event handler code for the current window.

Syntax

window.onafterprint = event handling code

Notes

Some browsers (including Firefox 6 and later and Internet Explorer) send beforeprint and afterprint events to let content determine when printing may have occurred. You can use this to adjust the user interface presented during printing (such as by displaying or hiding user interface elements during the print process).

The beforeprint event is raised after the user prints or aborts a print dialog.

Specification

Not part of any specification.

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatNo}} 6.0 {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
{{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

See also

  • {{domxref("window.print")}}
  • {{domxref("window.onbeforeprint")}}
  • Printing

Revision Source

<div>{{DomRef}}</div>


<h2 id="Summary">Summary</h2>

<p>The <code>onafterprint</code> property sets and returns the <code>onafterprint</code> event handler code for the current window.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">
window.onafterprint = <em>event handling code</em>
</pre>

<h2 id="Notes">Notes</h2>

<p>Some browsers (including Firefox 6 and later and Internet Explorer) send <code>beforeprint</code> and <code>afterprint</code> events to let content determine when printing may have occurred. You can use this to adjust the user interface presented during printing (such as by displaying or hiding user interface elements during the print process).</p>

<p>The <code>beforeprint</code> event is raised after the user prints or aborts a print dialog.</p>

<h2 id="Specification">Specification</h2>

<p>Not part of any specification.</p>

<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatNo}}</td>
        <td>6.0</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
      </tr>
    </tbody>
  </table>
</div>

<h2 id="See_also">See also</h2>
<ul>
  <li>{{domxref("window.print")}}</li>
  <li>{{domxref("window.onbeforeprint")}}</li>
  <li><a href="/en-US/docs/Printing" title="Printing">Printing</a></li>
</ul>
Revert to this revision