社区
JavaScript
帖子详情
document.all.webbrowser.execwb(6,1) 对象不支持此属性或方法
hujiefei
2013-10-16 11:16:07
如果禁用activeX就提示这个错误 有什么办法解决?
...全文
419
2
打赏
收藏
document.all.webbrowser.execwb(6,1) 对象不支持此属性或方法
如果禁用activeX就提示这个错误 有什么办法解决?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Alane_
2014-05-15
打赏
举报
回复
楼主,解决这个问题了吗?我也遇到这个问题了。。不知道怎么弄呢
洛洛罗罗
2013-12-03
打赏
举报
回复
坐等大神……
web
开发中常用的input事件汇总
1.
document.all.
Web
Browser
.
Exec
WB
(1,1) type=button value=打开 name=Button1> 2.
document.all.
Web
Browser
.
Exec
WB
(4,1) type=button value=另存为 name=Button2> 3.
document.all.
Web
Browser
.
Exec
WB
(10,1) type=button value=
属性
name=Button3> 4.
document.all.
Web
Browser
.
Exec
WB
(6,1) type=button value=打印 name=Button> 5.
document.all.
Web
Browser
.
Exec
WB
(8,1) type=button value=页面设置 name=Button4> 等等
html调用打印实现打印
html调用打印实现打印
input按钮的事件处理大全
1.<INPUT onclick=
document
.all.
Web
Browser
.
Exec
WB
(1,1) type=button value=打开 name=Button1> 2.<INPUT onclick=
document
.all.
Web
Browser
.
Exec
WB
(4,1) type=button value=另存为 name=Button2> 3.<INPUT onclick=
document
.all.
Web
Browser
.
Exec
WB
(10,1) type=button value=
属性
name=Button3> 4.<INPUT onclick=
document
.all.
Web
B
利用
Web
Browser
彻底解决
Web
打印问题(包括后台打印)
【利用
Web
Browser
彻底解决
Web
打印问题(包括后台打印) 】利用
Web
Browser
彻底解决
Web
打印问题(包括后台打印)BS架构下的打印大家是怎么解决的呢,我最近作了一个项目正好负责这一块,不仅要求打印页面的特定部分,还要求有后台的批量打印,在网上查了一些资料,最后终于解决了。抱着“取之于众 服务于众”的思想,我总结了一下,把它拿到网上来与大家分享,希望能帮助遇到类似问题的朋友。我主要使用了IE内置的
Web
Browser
控件,无需用户下载和安装。
Web
Browser
有很多功能,除打印外的其他功能就不再赘述了,你所能用到的打印功能也几乎全部可以靠它完成,下面的问题就是如何使用它了。先说显示后打印,后面说后台打印。1.首先引入一个
Web
Browser
在需要打印的页面,可以直接添加:到页面,或者使用JavaScript在需要的时候临时添加也可以:
document
.body.insertAdjacentHTML("beforeEnd","");2 .页面设置和打印预览如下所示,直接调用即可
document
.all.
Web
Browser
.
Exec
WB
(6,6) 直接打印
document
.all.
Web
Browser
.
Exec
WB
(8,1) 页面设置
document
.all.
Web
Browser
.
Exec
WB
(7,1) 打印预览或者:
exec
Script("
document
.all.
Web
Browser
.
Exec
WB
7, 1","VBScript");3 隐藏不打印的页面元素和分页CSS 有个Media
属性
,可以分开设置打印和显示的格式。如 … 中间的格式将只在打印时起作用,不会影响显示界面。所以可以设定.Noprint{display:none;}.PageNext{page-break-after: always;}然后给不想打印的页面元素添加: class="Noprint" ,那就不会出现在打印和打印预览中了。想分页的地方添加: 就可以了。4.打印页面的特定部分我是通过将需要打印的特定部分另建一个页面,然后装入主页面的一个IFrame中,再调用IFrame的打印
方法
,只打印IFrame中的内容实现的。如:下面的pringFrame js函数将只打印Iframe中的内容,可以直接引用使用,如printFrame(FrameId);window.print = printFrame;// main stufffunction printFrame(frame, onfinish) {if ( !frame ) frame = window;function
exec
OnFinish() {switch ( typeof(onfinish) ) {case "string":
exec
Script(onfinish); break;case "function": onfinish();}if ( focused && !focused.disabled ) focused.focus();}if (( frame.
document
.readyState !== "complete") &&( !frame.
document
.confirm("The
document
to print is not downloaded yet! Continue with printing?") )){
exec
OnFinish();return;}var eventScope = printGetEventScope(frame);var focused =
document
.activeElement;window.printHelper = function() {
exec
Script("on error resume next: print
WB
.
Exec
WB
6, 1", "VBScript");printFireEvent(frame, eventScope, "onafterprint");print
WB
.outerHTML = "";
exec
OnFinish();window.printHelper = null;}
document
.body.insertAdjacentHTML("beforeEnd","");printFireEvent(frame, eventScope, "onbeforeprint");frame.focus();window.printHelper = printHelper;setTimeout("window.printHelper()", 0);}// helpersfunction printIsNativeSupport() {var agent = window.navigator.userAgent;var i = agent.indexOf("MSIE ")+5;return parseInt(agent.substr(i)) >= 5 && agent.indexOf("5.0b1") < 0;}function printFireEvent(frame, obj, name) {var handler = obj[name];switch ( typeof(handler) ) {case "string": frame.
exec
Script(handler); break;case "function": handler();}}function printGetEventScope(frame) {var frameset = frame.
document
.all.tags("FRAMESET");if ( frameset.length ) return frameset[0];return frame.
document
.body;}Iframe中所装载页面的打印效果在所装载页面设置就可以了,如分页等。5.后台打印我是通过建一个隐藏Iframe实现的,当然仍然会有页面装载的过程。下面的函数创建Iframe装载页面并打印。如 printHidden(url) //url为页面地址function printHidden(url) {
document
.body.insertAdjacentHTML("beforeEnd","");var doc = printHiddenFrame.
document
;doc.open();doc.write("");doc.write("");doc.write("");doc.close();}function onprintHiddenFrame() {function onfinish() {printHiddenFrame.outerHTML = "";if ( window.onprintcomplete ) window.onprintcomplete();}printFrame(printHiddenFrame.printMe, onfinish);}它用到了printFrame,所以别忘了引用前面的函数。总之,
Web
Broswer已经为我们提供了解决方案,我们只要结合需求把它应用好就行了。
jsp页面如何实现
web
打印
首先引入一个
Web
Browser
在需要打印的页面,可以直接添加: 复制代码 代码如下: <object id="
Web
Browser
" classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height="0" width="0"> </object> 2 .页面设置和打印预览 如下所示,直接调用即可 复制代码 代码如下:
document
.all.
Web
Browser
.
Exec
WB
(6,6) 直接打印
document
.all.
Web
Browser
.
Exec
WB
(8,1) 页面设置
document
.all.
Web
Browser
.
Exec
WB
(7,1) 打印预览 3 隐藏不打印的页面元素和分页 CSS 有个Media
属性
,可以分开设置打印和显示的格式。 如 <style media="print" type="text/css"> …</style> 中间的格式将只在打印时起作用,不会影响显示界面。 所以可以设定 <style media="print" type="text/css"> .Noprint{display:none;} .PageNext{page-break-after: always;} </style> 然后给不想打印的页面元素添加: class="Noprint" ,那就不会出现在打印和打印预览中了。 想分页的地方添加:
就可以了。 4.打印页面的特定部分 通过将需要打印的特定部分另建一个页面,然后装入主页面的一个IFrame中,再调用IFrame的打印
方法
,只打印IFrame中的内容实现的。 如: <iframe visible" name="FrameId" width="100%" height="30%" src="NeedPrintedPage.asp"></iframe> 下面的pringFrame js函数将只打印Iframe中的内容,可以直接引用使用,如printFrame(FrameId); 复制代码 代码如下: window.print = printFrame; // main stuff function printFrame(frame, onfinish) { if ( !frame ) frame = window; function
exec
OnFinish() { switch ( typeof(onfinish) ) { case "string":
exec
Script(onfinish); break;
JavaScript
87,910
社区成员
224,616
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章