<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){}
}
//-->
</script>
<!--
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){}
}
//-->
</script>
解决方案 »
- 时间转换 (Tue Oct 30 2012 09:35:09 GMT+0800)
- myeclipse如何快速定位css
- google股票图表控件如何实现的
- JSF群, JSF的交流天地...
- 网站和信息平台的区别??
- 谁看过《深入体验Java Web开发内幕——核心基础》 张孝祥的,一起讨论一下吧。
- 怎么判断一个字符串都是ascii字符
- 联接mysql 出错了
- 各位高人,有前台用strtus作的,后面用ejb开发的模式吗?
- 用jspsmartupload上传文件时,怎么防止重名文件?如:服务器上已经有a.jpg文件,如果另一客户端此时又上传一a.jpg文件,怎么防止后者覆盖前者?
- 如何得到系统的时间,再将它写入数据库中呢?
- 十个人组成的网,数据库是集中式的,可不可称其是c/s模式?
[email protected] 谢谢
<script language="javascript">
function hide()
{
pagesetup_null();//加本句之前能打印
window.print();
}
</script>
加上后还能打印就是那些信息还有~怎么回事?
你的代码里hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"
是什么意思不是很懂能解释一下吗?
还有这段程序事不事去修改组册表的ActiveX控件了?不是很懂?运行时倒是没有警告提示,怎么回事?
<input type="button" value="打 印" name="butt" onClick="javascript:hide()">
<script language="javascript">
function hide(){ window.print();}
</script>
<body onload="pagesetup_null()">然后要给你的IE的安全级别降低
(好菜丫~~不敢乱改丫~赫赫~)