javascript打印设置页眉页脚
2014-06-16 15:13
453 查看
<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){} } </script> <input type="button" value="清空页码" onclick=pagesetup_null()> <input type="button" value="恢复页码" onclick=pagesetup_default()>
相关文章推荐
- 通过javascript设置打印网页时去掉页眉页脚
- Javascript页面打印的页眉页脚的清除与设置
- JavaScript实现网页打印,可设置页眉、页脚、页边距
- JAVASCRIPT实现网页打印,可设置页眉、页脚、页边距
- Javascript页面打印的页眉页脚的清除与设置
- WebBrowser 打印设置,打印预览,去页眉和页脚
- IE浏览器打印的页眉页脚设置解决方法
- JavaScript 实现打印无页眉页脚
- JS调用打印方法设置页眉页脚的实例
- 使用VBS实现打印页眉和页脚设置
- 利用vbs脚本设置IE的打印页眉页脚信息
- JavaScript IE 打印 以及如何去掉页眉页脚
- IE打印设置 页眉和页脚文本框中的符号及含义
- IE中设置页眉和页脚的打印格式
- JavaScript打印页面去除页眉页脚
- 去除IE浏览器打印时的页眉页脚及设置页边距--简单实用,一次性解决
- 设置网页打印的页眉页脚
- 浏览器菜单打印页眉页脚的设置
- JS打印设置空白页眉和页脚