【问题标题】:Can I detect if the user click print or cancel after windows.print?在 windows.print 之后,我可以检测用户是否单击打印或取消? 【发布时间】:2020-07-15 22:03:09 【问题描述】: 我想知道是否有任何方法可以知道用户在 windows.print 弹出后是否单击了打印或取消,因为如果用户打印 (PHP),我需要更新数据库。我已经看过有关此的帖子但它们很旧,但目前有可能吗? 【问题讨论】: 标签: javascript php printing 【解决方案1】: 你可以监听 afterprint 事件。 https://developer.mozilla.org/en-US/docs/Web/API/window.onafterprint 【讨论】: