打開新窗口後,print()在IE中不起作用。它適用於Chrome。 這裏有一個tester:js window.open然後打印()
<html>
<head>
<script type="text/javascript">
function openWin()
{
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<p>This is 'myWindow'</p>");
myWindow.focus();
myWindow.print(); //DOES NOT WORK
}
</script>
</head>
<body>
<input type="button" value="Open window" onclick="openWin()" />
</body>
</html>
您可以看看這個http://stackoverflow.com/questions/11448910/window-print-works-on-urls-except-one – 1355 2012-07-12 09:34:50
謝謝,這在IE11中適用於我。 – Sangeet 2015-01-30 05:21:45