您可以尝试以下两个代码示例:1:<script>function Print() { alert ("THUD.. another tree bites the dust!") if (document.layers) { window.print(); } else if (document.all) { WebBrowser1.ExecWB(6, 1); //use 6, 1 to prompt the print dialog or 6, 6 to omit it //some websites also indicate that 6,2 should be used to omit the box WebBrowser1.outerHTML = ""; }}</script><object ID="WebBrowser1" WIDTH="0" HEIGHT="0"CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>2:if (navigator.appName == "Microsoft Internet Explorer"){ var PrintCommand = '<object ID="PrintCommandObject" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>'; document.body.insertAdjacentHTML('beforeEnd', PrintCommand); PrintCommandObject.ExecWB(6, -1); PrintCommandObject.outerHTML = ""; } else { window.print();} 您可能需要将要测试的站点/页面添加到本地Intranet区域。