首先要把要打印的内容放在一个div里:我要打印的都放进id为:information1里面。 然后写个script 最后再用一个按钮 onclick这个方法 ...
打印类属性 方法定义 const Print function dom, options if this instanceof Print return new Print dom, options this.options this.extend noPrint : .no print , options if typeof dom string this.dom document.query ...
2019-07-27 16:53 0 619 推荐指数:
首先要把要打印的内容放在一个div里:我要打印的都放进id为:information1里面。 然后写个script 最后再用一个按钮 onclick这个方法 ...
JS部分的代码 <object id="WebBrowser" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A9 ...
...
加入以下js代码 <script language="javascript"> function preview(oper) { if (oper < 10){ bdhtml=window.document.body.innerHTML;//获取当前页的html代码 ...
示例1: 示例2: ...
1.在head标签内加入一段js 2.需要打印的内容用<!--startprint--><!--endprint-->包起来 3.加入一个打印按钮,调用之前的doPrint()方法 通过以上3步连接打印机就可以打印了,需要 ...
最近项目中需要用到打印HTML页面,需要指定区域打印,使用jquery.PrintArea.js 插件 用法: Javascript代码 $("div#printmain").printArea ...