在做项目的时候会常会遇到打印问题。
有时间我们需要选择性的打印,在网上找到一些方法,扩展了一下,经IE和firfox测试都可用。
把要打印的区域用<!--startprint--> 和 <!--endprint-->包括起来,然后中间不需要打印的用<!--startnotprint-->和<!--endnotprint-->包括起来。
经测试可用,就是有点困惑 window.document.body.innerHTML = prnhtml; 为会什么不会改变原来的页面。。。。。
详细代码迁移到这里了:https://lebang2020.cn/details/200914madqndxb.html