页面直接调用window.print(),能正常实现打印,现在想去掉页眉和页脚中的内容,脚本如下:
<script language="JavaScript">   
  var HKEY_Root,HKEY_Path,HKEY_Key;  
  HKEY_Root="HKEY_CURRENT_USER"; 
  HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";   
  function PageSetup_Null() 
  {    
      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,"");   
  }  
 </script>
页面调用PageSetup_Null()方法,IE浏览器错误如下:
行:28
字符:7
错误:Automation服务器不能创建对象发现是脚本代码var Wsh=new ActiveXObject("WScript.Shell"); 不能正常执行
麻烦高手给看看是什么原因,谢谢了