我正在 javascript 中做这样的事情来打印我页面的一部分点击链接
function printDiv() {
var divToPrint = document.getElementById('printArea');
var newWin = window.open();
newWin.document.write(divToPrint.innerHTML);
newWin.print();
newWin.close();
}
它在 Firefox 中运行良好,但在 IE 中不起作用。
有人可以帮忙吗