//打印
function printDialog()
{
if (navigator.appName == "Microsoft Internet Explorer")
{
try
{
var win=top.docnt.getElementById("main").contentWindow;//这是有frameset只打印name 为main的窗体
win.focus();
win.document.focus();
if (!PrintCommandObject)
{
var PrintCommand = '<object ID="PrintCommandObject" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
document.body.insertAdjacentHTML('beforeEnd', PrintCommand);
}
PrintCommandObject.ExecWB(6, 1);
}
catch(ex)
{
window.print();
}
}
else {
window.print();
}
}
js 打印页面信息
最新推荐文章于 2023-07-19 10:59:02 发布