打印頁面時去掉頁眉頁腳
發表時間:2023-07-27 來源:明輝站整理相關軟件相關文章人氣:
[摘要]<script language="JavaScript">var hkey_root,hkey_path,hkey_keyhkey_root="HKEY_...
<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()>
大多數人在上網的時候,都會瀏覽網頁提供給我們的信息。