html - IE当打印更多页面时,IE变得反应迟钝

时间:2015-09-28 03:40:14

标签: javascript html internet-explorer

首次打印后,我在IE中打印了更多页面,特定网页没有响应。我正在使用以下代码打印此内容,

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中运行良好。

IE规格:

  • 版本:IE 9
  • 操作系统:Windows 7

1 个答案:

答案 0 :(得分:0)

如果没有看到更多细节,则无法对您所提供的代码进行全面解剖。让我们了解有关浏览器的更多详细信息,如下所示:

  • IE版
  • 操作系统(&#34; Windows _&#34;我推测)

在此期间尝试禁用所有加载项。自从附加组件出现以来,这是IE的常见效率消耗。此外,如果这不能解决您的需求,请尝试以下主题:superuser forum post

相关问题