javascript - code printing in firefox but not printing in IE -
i have code below. working fine , printing document in firefox not printing or prompt print document in ie...
please help... thanks
<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>
yuppeeeeeeeeeeeees....... here working solution.... ie & firefox both :-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 iso-request" /> </body> </html>
Comments
Post a Comment