首先要把要打印的內容放在一個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 ...