关于document.execCommand('print'); document.execCommand('print')打印的是document的内容 是全部的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那如何调用才能打印特定的区域比如 一个ID=“one”的<Div></Div> 那如何调用才能打印特定的区域比如 一个ID=“one”的 <Div> </Div> 在本页面上打印的方法我还不清楚不过有一个变态的方法可以试试 <script LANGUAGE=javascript>function printArea(id){var inner=document.getElementById(id).innerHTMLdocument.frames["helpifm"].document.write(inner)document.frames["helpifm"].document.execCommand('print');}</script><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>弹出窗口</title> <style type="text/css"> td,input {font-size:12;color:#000} </style> </head> <body> <iframe src="helpifm" id="helpifm" style="display:none"></iframe><table width="480" height="370" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #C0CFB2;"> <tr> <td id=“top”> <a href="#" onclick="printArea('Bottom');" style="width: 72px" class="span"> 打印 </a> </td> <td id="Bottom"> .......... </td> </tr> </table> </body> </html> 这个方法的关键在于将你要打印的对象中内容考出来到一个 iframe中 ,然后用iframe中的document进行打印 内嵌样式 求jquery对话框插件 JAVASCRIPT函数传值问题 将弹出窗口页面执行的结果掉回本页面显示??? 有什么办法判断用户点开的页面是点击连接文字打开的,而不是在地址栏目输入地址后点刷新或者"转到"打开的 请推荐最好的学习JAVASCRIPT的书,有下载的电子书更好! 请问关于radio按钮,急?谢谢了 javascript正则表达式,挺详细的 javascript发邮件 js监听浏览器页面关闭触发事件,区别于刷新和跳转 setInterval小问题 谁有这样的Flash图片播放器
不过有一个变态的方法可以试试 <script LANGUAGE=javascript>
function printArea(id){
var inner=document.getElementById(id).innerHTML
document.frames["helpifm"].document.write(inner)
document.frames["helpifm"].document.execCommand('print');
}
</script><html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>弹出窗口</title>
<style type="text/css">
td,input {font-size:12;color:#000}
</style>
</head> <body>
<iframe src="helpifm" id="helpifm" style="display:none"></iframe>
<table width="480" height="370" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #C0CFB2;">
<tr> <td id=“top”>
<a href="#" onclick="printArea('Bottom');" style="width: 72px" class="span"> 打印 </a>
</td>
<td id="Bottom">
..........
</td>
</tr>
</table> </body> </html>