直接打印页面

 

在页面上直接打印 代码  javascript

不打印部分加上 class="Noprn" css

打印部分用 <!--startprint--> <!--endprint--> 括起来 html

<style type="text/css">
        @media Print         {             .Noprn             {                 display: none;             }         }     </style>     <script type="text/javascript">         function preview() {             bdhtml = window.document.body.innerHTML;             sprnstr = "<!--startprint-->"; eprnstr = "<!--endprint-->"; prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);             prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); window.document.body.innerHTML = prnhtml;             window.print();             history.go(0);         }     </script>
相关文章
相关标签/搜索