首页 新闻 赞助 找找看

window.Print()打印功能,火狐正常,IE浏览器中css样式无效

0
悬赏园豆:10 [待解决问题]

window.Print()打印功能,火狐正常,IE浏览器中css样式无效

代码:

function Print() {
                document.getElementById("btnPrint").style.display="none";
                bdhtml = window.document.body.innerHTML;
                sprnstr = "<!--startprint-->";
                eprnstr = "<!--endprint-->";
                prnhtml = bdhtml.substr(bdhtml.lastIndexOf(sprnstr));
                prnhtml = prnhtml.substring(0, prnhtml.lastIndexOf(eprnstr));
                window.document.body.innerHTML = prnhtml;
                window.print();
            }

lucy菜鸟的主页 lucy菜鸟 | 初学一级 | 园豆:194
提问于:2015-12-21 17:25
< >
分享
所有回答(1)
0

还是使用打印组件比较好

贺臣 | 园豆:307 (菜鸟二级) | 2015-12-21 20:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册