我有一个包含 iframe 的页面,我想使用 window.print()
打印它们,它在 chrome 中工作,但在 IE 中不工作,它只打印第一页而不是其余页面。
它只打印出第一页而不是其他 5 页。
任何帮助将非常感激!
最佳答案
不清楚您的情况,但可以提供帮助,在 IE window.print 中,与 chrome 和 firefox 不同,print 将始终尝试打印浏览器窗口,而不是您所在的 iframe 窗口。 要在 IE 中打印相应的 iframe 窗口,请执行以下操作。
window.top.document.getElementById("iframe-id").contentWindow.focus(); window.top.document.getElementById("iframe-id").contentWindow.print();
希望这对您有所帮助。
关于javascript - window.print 不打印 IE 中的所有页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31556426/