打印

<style> 
@media  print{ 
     #1 {  display:  none  } 

@media  screen{ 
     #2 {  display:  none  } 

</style>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0 VIEWASTEXT></OBJECT>
<OBJECT classid="CLSID:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B" height=0 id=reg name=reg width=0></OBJECT>
<script language=javascript> 
function doPageSet(){
  //Page Set
  WB.ExecWB(8,1)
}
function doPreview(){
  //Print
  WB.ExecWB(7,1)
}
function printit()
{
 if ( confirm( '确定打印吗?' ) )
 {
  reg.RegWrite("HKEY_CURRENT_USER//Software//Microsoft//Internet Explorer//PageSetup//footer","");
  reg.RegWrite("HKEY_CURRENT_USER//Software//Microsoft//Internet Explorer//PageSetup//header","");
  window.print();
 }
}
</script>

第一层打印预览及打印时都不显示!!!
<div  id=1>
<BUTTON onclick="doPreview()">打印预览</BUTTON>
<BUTTON onclick="doPageSet()">打印设置</BUTTON>
<BUTTON onclick="printit()">打印</BUTTON>
</div>
<br>
【<a href="javascript:doPreview();" class=black>打印预览</a>】&nbsp;
【<a href="javascript:doPageSet();" class=black>打印设置</a>】&nbsp;
【<a href="javascript:printit();" class=black>打印</a>】&nbsp;
【<a href="javascript:history.go(-1)" class=black>返回</a>】&nbsp;
【<a href="javascript:window.close()" class=black>关闭窗口</a>】
<br>
第二层是屏幕上不显示,但打印预览及打印时都显示!!!
<div  id=2>
应用语言学系报表!
</div>

 

 

 

 

你可能感兴趣的:(JavaScript,function,object,Class,div,button)