Javascript 在firefox中打印代码,但不在IE中打印

Javascript 在firefox中打印代码,但不在IE中打印,javascript,Javascript,我有下面的代码。它在firefox中工作良好,可以打印文档,但它不会打印,甚至不会提示在IE中打印文档 请帮忙。。。谢谢 <script type="text/javascript"> function PrintElemm(elem) { Popup($(elem).html()); } function Popup(data) { var mywindow = window.open('', 'my div', 'heigh

我有下面的代码。它在firefox中工作良好,可以打印文档,但它不会打印,甚至不会提示在IE中打印文档

请帮忙。。。谢谢

<script type="text/javascript">
    function PrintElemm(elem) {
        Popup($(elem).html());
    }
    function Popup(data) {
        var mywindow = window.open('', 'my div', 'height=400,width=600');
        mywindow.document.write('<html><head><title>Print Of - Completed ISO-Request Form</title>');
        mywindow.document.write('</head><body >');
        mywindow.document.write(data);
        mywindow.document.write('</body></html>');

        mywindow.print();
        mywindow.close();
        return true;
    }
</script>

函数PrintElemm(elem){
弹出($(elem.html());
}
功能弹出窗口(数据){
var mywindow=window.open(“”,'my div','height=400,width=600');
mywindow.document.write('打印-完成的ISO申请表');
mywindow.document.write(“”);
mywindow.document.write(数据);
mywindow.document.write(“”);
mywindow.print();
mywindow.close();
返回true;
}

是的。。。。。。。这是可行的解决方案。。。。对于IE和FireFox两者:-D

<script type="text/javascript">
  function completed()
  {
    var myWindow=window.open('','','width=600,height=400');
    myWindow.document.write("<html><head><title>Workflow System - Rejected Request Form</title></head>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<center><img src='images/cfi.png'></center>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<p><font color='black'>ISO-Request ID: </font><font color='red'><?php echo $rstd_comp['iso_id'];?></font> || <font color='black'>Completion Date:</font>  <font color='red'><?php echo $rstd_comp['comp_date'];?></font></p>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<p><font color='black'>Initiated By: </font><font color='red'><?php echo $rstd_comp['iso_req_name'];?></font> || <font color='black'>Forwarded By: </font><font color='red'><?php echo $rstd_comp['iso_req_bname'];?></font></p>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<p><font color='black'>Approved By: </font> <font color='red'><?php echo "( "; echo $rstd_comp['fwd_by']; echo" )";?></font> || <font color='black'>Sent By:</font>  <font color='red'><?php echo $rstd_comp['iso_itmgr'];?></font>                              </p>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<p><font color='black'>Completed By: </font> <font color='red'><?php echo "( "; echo $rstd_comp['iso_resp']; echo" )";?></font></p>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<hr>");

    myWindow.document.close();
    myWindow.focus();
    myWindow.print();
    myWindow.close();

  }
</script>
<body>

<input type="button" class="btn" onclick="completed()" value="Print this ISO-Request" />

</body>
</html>

函数已完成()
{
var myWindow=window.open('','',宽度=600,高度=400');
myWindow.document.write(“工作流系统-拒绝的请求表单”);
myWindow.document.write(“
”); myWindow.document.write(“”); myWindow.document.write(“
”); myWindow.document.write(“
”); myWindow.document.write(“ISO请求ID:| |完成日期:

”; myWindow.document.write(“
”); myWindow.document.write(“发起人:| |转发人:

”; myWindow.document.write(“
”); myWindow.document.write(“批准人:| |发送人:

”; myWindow.document.write(“
”); myWindow.document.write(“完成人:

”); myWindow.document.write(“
”); myWindow.document.write(“
”); myWindow.document.close(); myWindow.focus(); myWindow.print(); myWindow.close(); }
是的。。。。。。。这是可行的解决方案。。。。对于IE和FireFox两者:-D

<script type="text/javascript">
  function completed()
  {
    var myWindow=window.open('','','width=600,height=400');
    myWindow.document.write("<html><head><title>Workflow System - Rejected Request Form</title></head>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<center><img src='images/cfi.png'></center>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<p><font color='black'>ISO-Request ID: </font><font color='red'><?php echo $rstd_comp['iso_id'];?></font> || <font color='black'>Completion Date:</font>  <font color='red'><?php echo $rstd_comp['comp_date'];?></font></p>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<p><font color='black'>Initiated By: </font><font color='red'><?php echo $rstd_comp['iso_req_name'];?></font> || <font color='black'>Forwarded By: </font><font color='red'><?php echo $rstd_comp['iso_req_bname'];?></font></p>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<p><font color='black'>Approved By: </font> <font color='red'><?php echo "( "; echo $rstd_comp['fwd_by']; echo" )";?></font> || <font color='black'>Sent By:</font>  <font color='red'><?php echo $rstd_comp['iso_itmgr'];?></font>                              </p>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<p><font color='black'>Completed By: </font> <font color='red'><?php echo "( "; echo $rstd_comp['iso_resp']; echo" )";?></font></p>");
    myWindow.document.write("<hr>");
    myWindow.document.write("<hr>");

    myWindow.document.close();
    myWindow.focus();
    myWindow.print();
    myWindow.close();

  }
</script>
<body>

<input type="button" class="btn" onclick="completed()" value="Print this ISO-Request" />

</body>
</html>

函数已完成()
{
var myWindow=window.open('','',宽度=600,高度=400');
myWindow.document.write(“工作流系统-拒绝的请求表单”);
myWindow.document.write(“
”); myWindow.document.write(“”); myWindow.document.write(“
”); myWindow.document.write(“
”); myWindow.document.write(“ISO请求ID:| |完成日期:

”; myWindow.document.write(“
”); myWindow.document.write(“发起人:| |转发人:

”; myWindow.document.write(“
”); myWindow.document.write(“批准人:| |发送人:

”; myWindow.document.write(“
”); myWindow.document.write(“完成人:

”); myWindow.document.write(“
”); myWindow.document.write(“
”); myWindow.document.close(); myWindow.focus(); myWindow.print(); myWindow.close(); }
可能与此重复,但仍然相同。。。。没有发生任何事情请大家注意这件事很紧急,因为我的项目快完成了,需要在明天之前提交……可能是这件的复制品,但还是一样的。。。。没有发生任何事情请大家注意这件事很紧急,因为我的项目快完成了,需要在明天之前提交。。。。。