如何使网页打印的页眉页脚不打印出来!!!!
<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()>
网上的这个方法不行,连打印都打不出来!!!!!
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()>
网上的这个方法不行,连打印都打不出来!!!!!
...全文
相关推荐
网页打印去掉页眉页脚,以及控制不需要打印的内容
网页打印去掉页眉页脚,以及控制不需要打印的内容。源代码
js实现打印并去除页眉页脚功能
用js实现的web打印功能,可通过修改本地的注册表 去除页眉页脚
设置网页打印的页眉页脚为空和默认值,动态控制
设置网页打印的页眉页脚为空和默认值,动态控制 很实用的功能,一直用着的;
js iframe 打印 打印预览 页眉页脚的设置
NULL 博文链接:https://guoliangheyuqin.iteye.com/blog/1664562
web打印去掉页眉页脚,以及不想打印出的页面元素
web打印去掉页眉页脚,以及不想打印出的页面元素 博文链接:https://llying.iteye.com/blog/128212


Web 开发
