onafterprint 特性为 WindowEventHandlers 混合 EventHandler 为处理 afterprint events for the current window. These events are raised after the user prints, or if they abort the print dialog.

beforeprint and afterprint events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed. In general, you should prefer the use of a @media print CSS at-rule, but it may be necessary to use these events in some cases.

句法

window.addEventListener("afterprint", function(event) { ... });
window.onafterprint = function(event) { ... };
					

规范

规范 状态 注释
HTML 实时标准
The definition of 'onafterprint' in that specification.
实时标准

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
onafterprint Chrome 63 Edge 12 Firefox 6 IE Yes Opera 50 Safari 13 WebView Android 63 Chrome Android 63 Firefox Android ? Opera Android 46 Safari iOS 13 Samsung Internet Android 8.0

图例

完整支持

完整支持

兼容性未知 ?

兼容性未知

另请参阅

元数据

  • 最后修改: