<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>New Document </title>
    <style media="print">
        .noprint
        {
            display: none;
        }
    </style>
    <script type="text/javascript">
        var hkey_root, hkey_path, hkey_key
        hkey_root = "HKEY_CURRENT_USER"
        hkey_path = "http://www.cnblogs.com/zhongcj/admin/file://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) { }
        }
        //设置网页打印的页眉页脚为默认值
        function pagesetup_default() {
            try {
                var RegWsh = new ActiveXObject("WScript.Shell");
                hkey_key = "header";
                RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, "&w&b页码,&p/&P");
                hkey_key = "footer";
                RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, "&u&b&d");
            } catch (e) { }
        }
    </script>
</head>
<body>
    <object class/>
    </center>
    <div>
        要打印的内容</div>
</body>
</html>

相关文章:

  • 2021-12-12
  • 2021-08-05
  • 2022-12-23
  • 2021-12-03
  • 2021-06-12
  • 2022-01-29
  • 2021-06-16
  • 2022-12-23
猜你喜欢
  • 2021-09-14
  • 2021-06-03
  • 2021-12-12
  • 2022-12-23
  • 2021-09-22
  • 2021-07-12
  • 2021-12-12
相关资源
相似解决方案