以前用的 $("#print_div_contractnumber4").jqprint(); 现在不知为何不能用了

只能用下面的方法实现局部打印了

 //打印div
 function printDIV(){
            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();
 }

这个只打印 <!--startprint-->  和 <!--endprint-->之间的东西