我已经定义了onbeforeprint,并且我修改了我的html代码,现在一旦我完成打印后,选择了打印按钮,我希望打开onafterprint但它没有。Window.onbeforeprint和Window.onafterprint同时被解雇
而是当我按下Control + Print按钮时,onbeforeprint先被触发,然后显示onafterprint事件和打印对话框。
有没有什么办法可以在点击“打印”按钮后以某种方式对我的html进行更改?
正在使用IE浏览器-9和代码如下 代码
<script type="text/javascript">
window.onbeforeprint = function() {
alert('Hello');
}
window.onafterprint = function() {
alert('Bye');
}
</script>
感谢&问候, 弗朗西斯P.
您正在使用哪种浏览器?你可以发布一些你的javasript代码吗? – antonjs 2012-03-29 06:54:14
使用IE 9 – user581157 2012-03-29 07:23:53