JS Web打印

 <script language="javascript"> 
            //打印方法 
        function doPrint() {  
                //打开一个新的窗体 
            var newWin = window.open('about:blank',"",""); 
                //取得id为"order"的<div id="order"></div>之间的内容 
            var titleHTML = document.getElementById("order").innerHTML; 
               //将取得的打印内容放入新窗体 
            newWin.document.write(titleHTML); 
               //刷新新窗体 
            newWin.document.location.reload(); 
          //调用打印功能   
            newWin.print(); 
               //打印完毕自动关闭新窗体 
            newWin.close(); 
        } 
    </script> 

你可能感兴趣的:(JS Web打印)