JS打印设置空白页眉和页脚

来源:互联网 发布:新绝代双骄3mac 编辑:程序博客网 时间:2024/04/30 04:25

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()
{
 try{
  var RegWsh =  new ActiveXObject("WScript.Shell")
  hkey_key= "header"; 
  RegWsh.RegWrite(hkey_root+hkey_path+hkey_key, "")
  hkey_key= "footer";
  RegWsh.RegWrite(hkey_root+hkey_path+hkey_key, "")
 }catch(e){
  alert(e);
 }
}
</script>

 

原创粉丝点击