有没有办法通过一个按钮直接打印内容而没有预览或打印对话框?我的代码
<head>
<style type="text/css">
#printable { display: none; }
@media print
{
#non-printable { display: none; }
#printable { display: block; }
}
</style>
</head>
<body>
<div id="non-printable">
MY normal page contents
</div>
<div id="printable">
Printer version
</div>
</body>