【发布时间】:2020-08-31 21:11:43
【问题描述】:
我需要知道用户是否点击了print 或cancel 按钮,但如果点击其中任何一个按钮就会触发onafterprint 事件,为什么??
window.onafterprint = () => {
// event should fire only if print button is clicked
}
输入此page 并执行Ctrl + p 尝试cancel 或print 或save 文档并观看alert
谁能解释一下?
【问题讨论】: