其他分享
首页 > 其他分享> > 使用JS调用浏览器的打印功能

使用JS调用浏览器的打印功能

作者:互联网

一、使用插件

1.jquery.jqprint-0.3.js

二、编写HTML文件

<script src="./js/jquery-3.1.1.min.js"></script>
<script src="./js/jquery.jqprint-0.3.js"></script>
<script src="./js/print.js"></script>

<div>
    <span id="download">打印</span>
</div>
<div class="data-table" id="download-table">
   <table class="table table-hover">
      <thead>
         <tr>
            <td>项目员</td>
            <td>任务分值</td>
            <td>日志分值</td>
            <td>绩效分值</td>
            <td>绩效额度</td>
         </tr>
      </thead>
   </table>
</div>

三、编写js文件

$(function () {
    $("#print").click(function () {
        $( '#download-table' ).jqprint({
            debug: false,
            importCSS: true,
            printContainer: true,
            operaSupport: false
        });
    });
})

标签:function,调用,浏览器,jqprint,分值,JS,false,js,true
来源: https://www.cnblogs.com/nlbz/p/14900465.html