页面打印


1
function doPrint() { 2 bdhtml = window.document.body.innerHTML; 3 sprnstr = "<!--startprint-->"; 4 eprnstr = "<!--endprint-->"; 5 prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17); 6 prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); 7 window.document.body.innerHTML = prnhtml; 8 window.print(); 9 }

页面打印代码片段

posted @ 2015-06-29 16:28  shall@we  阅读(130)  评论(0编辑  收藏  举报