关于JavaScript打印问题 用一个隐藏的 iframe 打开它,就可以随意操作了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 同意: bencalie(Bencalie) 的 在a中使用iframe,iframe的url为b.jsp;在页面加载的时候,设置b.body.style.diaplay="none";//隐藏;当在a中打印事件中写function printb(){ document.frames["iframename"].focus(); //b页面获得焦点 document.frames["iframename"].document.body.style.display=""; //显示 document.frames["iframename"].print(); //打印 document.frames["iframename"].document.body.style.display="none";//隐藏} 为什么不让用?这不是很好吗!Seeko0(阿 枫) 已经解决了啊 我要的是打印预览窗口呀不是print() <OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0> </OBJECT> <input onclick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开 name=Button1> <input onclick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为 name=Button2> <input onclick=document.all.WebBrowser.ExecWB(10,1) type=button value=属性 name=Button3> <input onclick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印 name=Button> <input onclick=document.all.WebBrowser.ExecWB(7,1) type=button value=打印预览name=Button> <input onclick=document.all.WebBrowser.ExecWB(8,1) type=button value=页面设置 name=Button4> <br/> <input onclick=window.location.reload() type=button value=刷新 name=refresh> <input onclick="window.external.ImportExportFavorites(true,'');" type=button value=导入收藏夹 name=Button5> <input onclick="window.external.ImportExportFavorites(false,'');" type=button value=导出收藏夹 name=Button32> <input onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夹 name=Button22> <br/> <input onclick="window.external.ShowBrowserUI('OrganizeFavorites', null)" type=button value=整理收藏夹 name=Submit2> <input onclick='window.location="view-source:" + window.location.href' type=button value=查看源文件 name=Button7> <input onclick="window.external.ShowBrowserUI('LanguageDialog', null)" type=button value=语言设置 name=Button6> <input onclick=history.go(1) type=submit value=前进 name=Submit> <input onclick=history.go(-1) type=submit value=后退 name=Submit2> 你要预览非要使用ActiveX控件不可,也可以先不执行打印操作,只显示,点击打印再进行打印 <input onclick=document.all.WebBrowser.ExecWB(7,1) type=button value=打印预览name=Button>上面的预览功能不行 html求教,为什么2345对应的图片上的链接没效果 jquery按左右按钮滚动改自动(请教高手解决) 如何使用纯粹的JavaScriptF访问.NET_WEB服务 .js+数字 用于验证的问题 javascript怎么把二进制数写进注册表 这个值怎么获取?在线等 请问javascript用什么函数取一个数值的整数和小数点后面的部分,急用,在线等,谢谢 想买一个web ui框架,大家推荐一下 如何在JavaScript中引入类? 求教:点击了IE右上角的“X”叉,如何不让IE关闭?百分相赠! 在线求助 如何用JAVASCRIPT对数据库进行删除一条记录的操作?
在页面加载的时候,设置b.body.style.diaplay="none";//隐藏;
当在a中打印事件中写
function printb(){
document.frames["iframename"].focus(); //b页面获得焦点
document.frames["iframename"].document.body.style.display=""; //显示
document.frames["iframename"].print(); //打印
document.frames["iframename"].document.body.style.display="none";//隐藏}
不是print()
</OBJECT>
<input onclick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开 name=Button1>
<input onclick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为 name=Button2>
<input onclick=document.all.WebBrowser.ExecWB(10,1) type=button value=属性 name=Button3>
<input onclick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印 name=Button>
<input onclick=document.all.WebBrowser.ExecWB(7,1) type=button value=打印预览name=Button>
<input onclick=document.all.WebBrowser.ExecWB(8,1) type=button value=页面设置 name=Button4>
<br/>
<input onclick=window.location.reload() type=button value=刷新 name=refresh>
<input onclick="window.external.ImportExportFavorites(true,'');" type=button value=导入收藏夹 name=Button5>
<input onclick="window.external.ImportExportFavorites(false,'');" type=button value=导出收藏夹 name=Button32>
<input onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夹 name=Button22>
<br/>
<input onclick="window.external.ShowBrowserUI('OrganizeFavorites', null)" type=button value=整理收藏夹 name=Submit2>
<input onclick='window.location="view-source:" + window.location.href' type=button value=查看源文件 name=Button7>
<input onclick="window.external.ShowBrowserUI('LanguageDialog', null)" type=button value=语言设置 name=Button6>
<input onclick=history.go(1) type=submit value=前进 name=Submit>
<input onclick=history.go(-1) type=submit value=后退 name=Submit2>