JavaScript 实现打印无页眉页脚
2007-06-12 11:33
411 查看
test page print<br>
xxxxxxxxxxx<br>
yyyyyyyyyyyyyy<br>
kkkkkkkkkkkk<br>
<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)...{}
}
// 设置页眉页脚为默认值
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)...{}
}
// 打印
function PrintPage()
...{
PageSetup_Null() ;
window.print() ;
PageSetup_Default() ;
}
</Script>
<a href="#" onClick="PrintPage();">Print Page</a>
相关文章推荐
- JavaScript实现网页打印,可设置页眉、页脚、页边距
- JAVASCRIPT实现网页打印,可设置页眉、页脚、页边距
- 关于JavaScript打印去掉页眉页脚
- JavaScript IE 打印 以及如何去掉页眉页脚
- web打印,巧妙实现隐藏不想打印的页面元素,以及页眉和页脚
- 使用javascript去掉打印网页时页眉与页脚的内容
- javascript实现window.print()去除页眉页脚
- Javascript页面打印的页眉页脚的清除与设置
- javascript实现window.print()去除页眉页脚
- web打印,巧妙实现隐藏不想打印的页面元素,以及页眉和页脚
- 通过javascript设置打印网页时去掉页眉页脚
- 利用vbs脚本实现设置IE的打印页眉页脚信息
- JavaScript打印页面去除页眉页脚
- javascript打印设置页眉页脚
- 使用VBS实现打印页眉和页脚设置
- Js 实现打印并去除页眉页脚
- Javascript页面打印的页眉页脚的清除与设置
- 使用VBS实现打印页眉和页脚设置
- web打印,巧妙实现隐藏不想打印的页面元素,以及页眉和页脚
- JavaScript 打印去掉页眉页脚