首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

js兑现(可实现局部打印)

2012-08-21 
js实现(可实现局部打印)http://www.iteye.com/topic/1114154? ????function doPrint() {??? bdhtml wind

js实现(可实现局部打印)

http://www.iteye.com/topic/1114154?

?

?

?

?

function doPrint() {
??? 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();
}

?

<boby>

?<!--startprint-->

?

要打印的内容

?

<!--endprint-->

?

<boby>

热点排行