随笔-8  评论-27  文章-0  trackbacks-1
<html>
<head><title>打印</title></head>
<script>
function fn01()
{
 try
 {
 var Wsh=new ActiveXObject("WScript.Shell");
 HKEY_Key="header";
 Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
 HKEY_Key="footer";
 Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
 }
 catch(e){}
 document.getElementById("div1").style.display="none";
 document.all.WebBrowser.ExecWB(7,1);
 document.getElementById("div1").style.display="block";
}
function fn02()
{
 try
 {
 var Wsh=new ActiveXObject("WScript.Shell");
 HKEY_Key="header";
 Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
 HKEY_Key="footer";
 Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
 }
 catch(e){}
 document.getElementById("div1").style.display="none";
 document.all.WebBrowser.ExecWB(6,1);
 document.getElementById("div1").style.display="block"; 
}
</script>
<body>
<OBJECT   id=WebBrowser   classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2   height=0   width=0></OBJECT>
<div id="sp1">这里填写打印内容</div>
<div id="div1">
  <input   type=button   value=打印           onclick=fn02()>    
  <input   type=button   value=页面设置   onclick=document.all.WebBrowser.ExecWB(8,1)>                      
  <input   type=button   value=打印预览   onclick=fn01()>
</div>
</body>
</html>
posted on 2008-07-14 09:34 OoLaLa 阅读(263) 评论(3)  编辑 收藏

评论:
#1楼  2008-07-14 10:24 | jhtchina      
学的不错,学习
引用

  回复  引用  查看    
#2楼  2008-07-14 10:56 | 深蓝      
貌似不支持FireFox
  回复  引用  查看    
#3楼  2008-08-14 16:03 | 123123123123123123 [未注册用户]
不支持IE7
  回复  引用    

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      


相关链接: