WEB无控件打印.javascript里有一个方法竟然可以调出打印窗口,而且不用安装任何控件.
下面是用window.open()实现的。
有兴趣的朋友再加工一下,就可以实现打印指定页面的内容的了。
<head>
<script language=javascript>
function print()
{
var sHTML = '<body>哈哈哈,无控件WEB打印</body>';
var oWin = window.open('', 'printwindow', 'menubar=no,location=no,resizable=yes,scrollbars=no,status=no,width=400,height=300');
if(oWin) {
oWin.document.open();
oWin.document.write(sHTML);
oWin.document.close();
oWin.print();
oWin.close();
}
else {
}
}
</script>
</head>
<span onclick="print()">Click Here To Print</span>
博客介绍了在WEB中利用JavaScript实现无控件打印的方法。通过window.open()可调出打印窗口,无需安装任何控件。文中给出了具体代码示例,点击指定元素即可触发打印功能,还可进一步加工实现打印指定页面内容。

被折叠的 条评论
为什么被折叠?



