<div class="codetitle"> <span><a style="CURSOR: pointer" data="40591" class="copybut" id="copybut40591" onclick="doCopy('code40591')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code40591"> <br><script> <BR>var hkey_root,hkey_path,hkey_key <BR>hkey_root="HKEY_CURRENT_USER" <BR>hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\" <BR>//设置网页打印的页眉页脚为空 <BR>function pagesetup_null() <BR>{ <BR>try{ <BR> var RegWsh = new ActiveXObject("WScript.Shell") <BR> hkey_key="header" <BR> RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"") <BR> hkey_key="footer" <BR> RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"") <BR> }catch(e){alert(e.name+" "+e.message)} <BR>} <BR>//设置网页打印的页眉页脚为默认值 <BR>function pagesetup_default() <BR>{ <BR> try{ <BR> var RegWsh = new ActiveXObject("WScript.Shell") <BR> hkey_key="header" <BR> RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&P") <BR> hkey_key="footer" <BR> RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&u&b&d") <BR> }catch(e){alert(e.name+" "+e.message)} <BR>} <BR></script> <br> <br><input> <br><input> <br> <br> </div>