IE下,右键网页,点击“打印”,能扑捉到这个事件并且执行一段js么? RT:IE下,右键网页,点击“打印”,能扑捉到这个事件并且执行一段js么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 打印按钮:<INPUT onclick="PRT3onclick()" type="button" value="打 印">js.function PRT3onclick(){ //a()要执行的js在此处调用 WebBrowser.ExecWB(6,1);}<OBJECT id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" ></OBJECT> 错误提示:WebBrowser is not defined[Break on this error] WebBrowser.ExecWB(6,1); <script>//按钮事件 var directPrint = function(){ pagesetup_null(); document.all.WebBrowser.ExecWB(6,6); }//设置网页打印的页眉页脚为空function pagesetup_null(){ var hkey_root,hkey_path,hkey_key; hkey_root="HKEY_CURRENT_USER" hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"; 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> </HEAD> <body> <input type=button name="打印" value="打印" style="font-size: 9pt; min-width:15px; min-height:10px" onclick="directPrint()" id="Button1" /> <OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0> </OBJECT> web 进度条~~~~ 散分一百,请教一个ASP.NET表单验证的疑难问题 为什么我的vs2010不能uml建模呢?没有新增的建模项目模板——Modeling Project 请教一个VS2008中验证控件验证金额的正则表达式! ASP.NET是否要掌握C# 求二个随机数 程序,有范围限制 拜托大家帮忙看看这个错误是怎么回事?! 如何区别 托管资源 与 非托管资源 ?? .net一个网站编译前和后的奇怪问题,请大家帮忙。。。。。 如何取出datalist中<ItemTemplate>面板中记录的字段值? 关于记录网站历史总访问量的问题~~求高手解答 网站发布问题!
function PRT3onclick()
{
//a()要执行的js在此处调用
WebBrowser.ExecWB(6,1);
}
<OBJECT id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" >
</OBJECT>
WebBrowser is not defined
[Break on this error] WebBrowser.ExecWB(6,1);
var directPrint = function(){
pagesetup_null();
document.all.WebBrowser.ExecWB(6,6);
}//设置网页打印的页眉页脚为空
function pagesetup_null(){
var hkey_root,hkey_path,hkey_key;
hkey_root="HKEY_CURRENT_USER"
hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
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>
</HEAD>
<body> <input type=button name="打印" value="打印" style="font-size: 9pt; min-width:15px; min-height:10px" onclick="directPrint()" id="Button1" />
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0>
</OBJECT>