用JS去掉打印的页眉页脚

1 < script language = " JavaScript " >
2 var hkey_key;
3 var hkey_root = " HKEY_CURRENT_USER " ;
4 var hkey_path = " \\Software\\Microsoft\\Internet Explorer\\PageSetup\\ " ;
5 // 设置网页打印的页眉页脚为空
6 function pagesetup_null()
7 {
8
9var RegWsh = new ActiveXObject("WScript.Shell");
10hkey_key="header";
11RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"");
12hkey_key="footer";
13RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"");
14
15}
16
17 // 设置网页打印的页眉页脚为默认值
18 function pagesetup_default()
19 {
20try{
21var RegWsh = new ActiveXObject("WScript.Shell");
22hkey_key="header";
23RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&P");
24hkey_key="footer";
25RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&u&b&d");
26}catch(e){}
27}
28 【用JS去掉打印的页眉页脚】转载于:https://www.cnblogs.com/cnzhouhai/archive/2007/09/12/890844.html

    推荐阅读