在第二个框架页(即按钮所在页)加
<style type=text/css>
@media print {body{display:none}}
</style><script language="VBScript">
dim hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
'//设置网页打印的页眉页脚为空
function pagesetup_null()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
end function
'//设置网页打印的页眉页脚为默认值
function pagesetup_default()
on error resume next
Set RegWsh = CreateObject("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"
end function
</script>
<style type=text/css>
@media print {body{display:none}}
</style><script language="VBScript">
dim hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
'//设置网页打印的页眉页脚为空
function pagesetup_null()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
end function
'//设置网页打印的页眉页脚为默认值
function pagesetup_default()
on error resume next
Set RegWsh = CreateObject("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"
end function
</script>
解决方案 »
- asp.net 調用jquery的方法出現錯誤
- 多版本ie,firefox共存官方网站的一个软件疑问
- 求一个新浪微博登录时的提示js效果
- 我郁闷死。为什么显示不出来IFrame 窗口的内容??
- 我想使<img src="checkbox2.gif" style="display:block"/>fgfg文字和图片之间不换行,不知道行否。。。
- 刚刚接触正则,问个小问题。希望给与解答。谢谢。对不起分用光了。只能拜托了。
- js文件同时执行插入和更新的post,为何总是先运行后面的一个呢?
- Javascript里面有POST REQUEST的功能吗?
- 向父窗口写数据的问题,急!在线等待!
- 怎样将div总是显示在屏幕的中央?如果层拖动改变的位置,怎样雇这个位置?
- 同名radio的取值
- 不知JS怎样读取URL传来的值?
<input type=button value="打印" onclick="window.print()">
<!--
function printdoc(){
parent.frames[1].window.print();}//-->
</SCRIPT>