62,243
社区成员




var RegWsh = new ActiveXObject("WScript.Shell");
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" id="wb" width="0" height="0"></OBJECT>
<div id="bankwrap">
<p class="Noprint">
<span style="cursor:pointer; color:#0000FF" onclick="printpreview();">打印预览</span>
<span style="cursor:pointer; color:#0000FF" onclick="prints();" class="Noprint">打印</span>
</p>
</div>
<div class="banktitle">内容</div>
</div>
//配置网页打印的页眉页脚为空
function pagesetup_null(){
try{
var RegWsh = new ActiveXObject("WScript.Shell");
hkey_key="header";
RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"");
hkey_key="footer";
RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"");
}catch(e){}
}
//打印页面预览
function printpreview(){
pagesetup_null();
try{
wb.execwb(7,1);
}catch(e){
alert("您的浏览器不支持此功能,请选择'文件'->'打印预览'");
}
}