1: <OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
2: <input type=button value=打印 onclick=document.all.WebBrowser.ExecWB(6,1)>
3: <input type=button value=直接打印 onclick=document.all.WebBrowser.ExecWB(6,6)>
4: <input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
5: <input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1)>
2: <input type=button value=打印 onclick=document.all.WebBrowser.ExecWB(6,1)>
3: <input type=button value=直接打印 onclick=document.all.WebBrowser.ExecWB(6,6)>
4: <input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
5: <input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1)>
是可以打印的这段代码可以打印,但是没有内容:(
var pwin=window.open('about:blank' );
pwin.print();
}
改成
pwin.document.write("\n<"+"script defer>"+"\nwindow.print();\nwindow.opener=null;\nsetTimeout('window.close();',3000);<"+"/script>")
}
试试看行不