zoukankan      html  css  js  c++  java
  • .net打印

    <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();//加载页面

  • 相关阅读:
    Spring 总结
    分布式缓存Memcache
    Docker原理 -- namespace与CGroup
    JDK源码分析--Collections
    React生命周期总结
    【转】前端优化的35条
    http缓存与cdn相关技术
    跨域处理
    sequekize
    orm2
  • 原文地址:https://www.cnblogs.com/sdya/p/4674172.html
Copyright © 2011-2022 走看看