Yuppeeeeeeeeeeeeeees.......这是有效的解决方案......适用于 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>