jsp 点击打印按钮显示的打印预览为自己设置的页面,并且ie和ff都兼容,可打印
<stylemedia="print">.noprint{display:none;}</style><scriptlanguage="JavaScript">funct...
<style media="print">
.noprint { display : none; }
</style>
<script language="JavaScript">
function doPrintSetup(){
//打印设置
printWB.ExecWB(8,1)
}
function doPrintPreview(){
//打印预览
printWB.ExecWB(7,1)
}
function doPrint(){
//直接打印
printWB.ExecWB(6,6)
}
</script>
</head>
<body>
<div class="noprint">
<object id="printWB" style="dispaly:none" classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"></object>
<input type="button" value="打印设置" onclick="doPrintSetup();"></input>
<input type="button" value="打印预览" onclick="doPrintPreview();"></input>
<input type="button" value="直接打印" onclick="doPrint();"></input>
<input type="button" value="关闭窗口" onclick="printWB.ExecWB(45,1);"></input>
</div>
这个只有ie可以,ff不可以,有没有兼容ie和火狐 展开
.noprint { display : none; }
</style>
<script language="JavaScript">
function doPrintSetup(){
//打印设置
printWB.ExecWB(8,1)
}
function doPrintPreview(){
//打印预览
printWB.ExecWB(7,1)
}
function doPrint(){
//直接打印
printWB.ExecWB(6,6)
}
</script>
</head>
<body>
<div class="noprint">
<object id="printWB" style="dispaly:none" classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"></object>
<input type="button" value="打印设置" onclick="doPrintSetup();"></input>
<input type="button" value="打印预览" onclick="doPrintPreview();"></input>
<input type="button" value="直接打印" onclick="doPrint();"></input>
<input type="button" value="关闭窗口" onclick="printWB.ExecWB(45,1);"></input>
</div>
这个只有ie可以,ff不可以,有没有兼容ie和火狐 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询