当IE打印更多页数时,IE变得无响应

IE when printing more number of pages then IE became unresponsive

本文关键字:IE 响应 打印      更新时间:2023-09-26

我在IE中从html中打印更多的页面,第一次打印特定的网页变得无响应。我使用下面的代码

打印它
function printdData(content)
{
    var textPopupWindow = window.open('','popup','toolbar=no,menubar=no,width=1,height=1 left=-5000');
    textPopupWindow.document.open();
    textPopupWindow.document.write(getPrintData(content));
    textPopupWindow.document.close();
}
function getPrintData(printData)
{
    return "<html moznomarginboxes mozDisallowSelectionPrint>'n" +
    "<head>'n" +
    "<meta http-equiv='"X-UA-Compatible'" content='"IE=8'" />'n" +
    "<script>'n" +       
    "function step1() {'n" +
    "  setTimeout('step2()', 10);'n" +
    "}'n" +
    "function step2() {'n" +
    "  window.print();'n" +
    "  window.close();'n" +
    "}'n" +        
    "</script>'n" +    
    "<style type='"text/css'" media='"print'">'n" +
    "@page 'n" +
    "{'n" +
        "size: auto;'n" +
        "margin-top: 0.25in;'n" +
        "margin-bottom: 0.25in;'n" +
    "}'n" +    
    "</style>'n" +
    "</head>'n" +
    "<body onLoad='step1()' style='"font-size: 12px;'">'n" +
    printData +
    "</body>'n" +
    "</html>'n";
}

这是我用来打印从网页生成的html内容的代码。'printData'包含要打印的html内容。此问题仅在IE中存在,但在chrome和firefox中可以正常工作。

即规格:

  • 版本:ie9
  • 操作系统:Windows 7

如果没有看到更多的细节,就无法对您提供的代码进行完整的分析。让我们像下面这样了解更多关于浏览器的细节:

    <
  • IE版本/gh>
  • 操作系统("Windows _"我假设)

同时尝试禁用所有附加组件。自插件出现以来,这是IE常见的效率消耗问题。此外,如果这不能解决你需要的,试试这个线程:超级用户论坛帖子