首页 > Web开发 > 详细

.net打印

时间:2015-07-24 20:07:01      阅读:284      评论:0      收藏:0      [点我收藏+]

<input type="button" onclick="javascript:printit()"></input>//打印整个html网页.

//打印局部html网页 extjs中的例子

 bdhtml = window.document.body.innerHTML;
    startprint = ("<div>");
    endprint = ("</div>");
    printhtml = bdhtml.substr(bdhtml.indexOf(startprint) );
    printhtml = printhtml.substr(0, printhtml.indexOf(endprint));
    window.document.write(‘<html>‘);
    window.document.write(‘<head>‘);
    window.document.write(‘<title>打印列表</title>‘);
    window.document.write(‘</head>‘);
    window.document.write(‘<body><from>‘);
    window.document.write(printhtml);
    window.document.write(‘<from></body>‘);
    window.document.write(‘</html>‘);
    window.print();
    window.location.reload();//加载页面

 

.net打印

原文:http://www.cnblogs.com/sdya/p/4674172.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!