等待打印完成 - Jquery Asp.net MVC
我是新手。如果这是一个非常基本的问题,请原谅。我在 window.print() 上隐藏和显示 CSS。在 IE8 和 FF 上,页面执行停止,直到我对打印做出响应(打印或取消),然后它再次启动并完成页面加载。但在 IE6 和 IE7 上,页面加载不会等到我在打印对话框上做出响应。如何暂停页面执行,直到我在打印对话框上做出响应(打印或取消)?我不想使用 settimeout 因为它是针对特定时间的。如果我选择立即打印,则页面将不会加载,直到设置超时到期,反之亦然。请帮忙。
I am a newbie. please excuse me if it is a very basic question. I am hiding and showing CSS on window.print(). on IE8 and FF The page execution stops until i respond on print ( either print or cancel) and then it starts again and completes the page load. But on IE6 and IE7 the page load is not waiting until i respond on print dialog box. How can I pause Page execution until I respond ( either print or cancel) on the print dialog box? I do not want to use settimeout since it is for a specific time. If i choose to print immediately the page will not load untill settimeout expires and vice versa. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要在
window.print()
上隐藏和显示。它永远不会正常工作,并且会导致其他问题。相反,使用单独的打印 CSS 文件:
该文件将定义打印样式,例如:
然后您可以标记不想打印的元素:与
window.print()
,这适用于禁用 JavaScript 的情况。Don't hide and show on
window.print()
. It will never work correctly, and will cause other issues.Instead, use a separate, print CSS file:
This file will define styles for printing, like:
You can then mark up elements you don't want to print:
Unlike hiding and showing on
window.print()
, this works with JavaScript disabled.