1銆灞閮ㄦ墦鍗版柟娉曪細
浣滅敤錛氬皢id涓篸ayin鐨勫唴瀹癸紝鏂板緩欏甸潰騫舵墦鍗幫紝鍙В鍐蟲墦鍗版煇欏甸潰涓殑閮ㄥ垎鍐呭鐨勯棶棰樸?br> 浣跨敤鏂規硶錛氬皢瑕佹墦鍗扮殑鍐呭閫氳繃 <span id="dayin"></span>鍖呭惈璧鋒潵錛岀劧鍚庡湪鏌愪釜鎸夋壄涓畾涔?br> 浜嬩歡
<input type="button" onclick="dayin()" value="鎵撳嵃">
function dayin()
{
var code="<body onload=window.print()>"
code+=document.all.dayin.innerHTML;
code=code.toUpperCase();
code=code.replace(/<A[^>]*>鍒犻櫎</A>/gi, "");
code=code.toLowerCase();
var newwin=window.open('','','');
newwin.opener = null;
newwin.document.write(code);
newwin.document.close();
}
鍏朵腑code=code.replace(/<A[^>]*>鍒犻櫎</A>/gi, "");
2銆鍒╃敤CSS瀹炵幇灞閮ㄦ墦鍗?br> 浠嬬粛涓や釜鍏抽敭鐨凜SS
<style media="print">
.Noprint { DISPLAY: none }
.PageNext{ PAGE-BREAK-AFTER: always }
</style>絎竴涓湪涓嶉渶瑕佹墦鍗扮殑鏍囩涓婃坊鍔狅紙瀛愭爣絳句篃灝嗕笉琚墦鍗幫級錛岀浜屼釜鍦ㄩ渶瑕佹崲琛岀殑鏍囩澶勬坊鍔狅紙璇ユ爣絳炬墍琛ㄧず鐨勫唴瀹瑰皢鍦ㄥ綋鍓嶆墦鍗扮殑涓欏靛唴錛?br> 鎺ヤ笅鏉ラ氳繃璋冪敤鏈鍩烘湰鐨刯s璇彞
window.print()灝卞彲瀹炵幇欏甸潰灞閮ㄦ墦鍗頒簡錛屽緢easy鍚э紒
3銆鎵撳嵃棰勮
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
height=0 id=wb name=wb width=3></OBJECT>
<input class="ipt" type=button name= button _print value="鎵撳嵃"
onclick =" javascript :printit();">
<input class="ipt" type=button name=button _setup value="鎵撳嵃欏甸潰璁劇疆"
onclick =" javascript : printsetup();">
<input class="ipt" type=button name=button_show value="鎵撳嵃棰勮"
onclick="javascript:printpreview();">
<input class="ipt" type=button name= button _fh value="鍏抽棴"
onclick =" javascript:window.close();">