3个回答
2013-08-06
展开全部
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
<input type=button value=打印 onclick=document.all.WebBrowser.ExecWB(6,1)>
<input type=button value=直接打印 onclick=document.all.WebBrowser.ExecWB(6,6)>
<input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
<input type=button value="打印OK" onclick=" return myprint(this);">
<input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1)> 看不到图
<input type=button value=打印 onclick=document.all.WebBrowser.ExecWB(6,1)>
<input type=button value=直接打印 onclick=document.all.WebBrowser.ExecWB(6,6)>
<input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
<input type=button value="打印OK" onclick=" return myprint(this);">
<input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1)> 看不到图
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-08-06
展开全部
使用js <font style=\"color:#ffffff\" onclick=\"window.print();\">开始打印</font>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-08-06
展开全部
利用div标签,将待打印的内容放在div标签里,执行局部打印。示例代码:
<html>
<head>
<script language= "javascript ">
function printdiv(printpage)
{
var headstr = " <html> <head> <title> </title> </head> <body> ";
var footstr = " </body> ";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
</script>
</head>
<input type= "button " value= "print " onclick= "printpage( 'printpage ') "/>
...
<div id= "printpage ">
<!--要打印得内容-->
</div>
...
</html>
<html>
<head>
<script language= "javascript ">
function printdiv(printpage)
{
var headstr = " <html> <head> <title> </title> </head> <body> ";
var footstr = " </body> ";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
</script>
</head>
<input type= "button " value= "print " onclick= "printpage( 'printpage ') "/>
...
<div id= "printpage ">
<!--要打印得内容-->
</div>
...
</html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询