IE 7 ActiveX事件和Javascript [英] IE 7 ActiveX Events and Javascript

查看:73
本文介绍了IE 7 ActiveX事件和Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在使用OBJECT标记在页面上托管的ActiveX控件,例如:

I am working on an ActiveX control that is hosted on a page using an OBJECT tag, like:

< OBJECT ID =" objectID" WIDTH = 0 HEIGHT = 0
CLASSID =" CLSID:XXXXXXXXXXXXXXXXXXXXX" VIEWASTEXT>
< PARAM NAME =" _Version" VALUE =" 65535">
< PARAM NAME =" _ExtentX" VALUE =" 0">
< PARAM NAME =" _ExtentY" VALUE =" 0">
< PARAM NAME =" _StockProps" VALUE =" 0">
< / OBJECT>

<OBJECT ID="objectID" WIDTH=0 HEIGHT=0
 CLASSID="CLSID:XXXXXXXXXXXXXXXXXXXXX" VIEWASTEXT>
 <PARAM NAME="_Version" VALUE="65535">
 <PARAM NAME="_ExtentX" VALUE="0">
 <PARAM NAME="_ExtentY" VALUE="0">
 <PARAM NAME="_StockProps" VALUE="0">
</OBJECT>

然后有一个脚本标签,格式为:

And then have a script tag with the format:
 

< SCRIPT LANGUAGE =" JavaScript" FOR ="&的objectID QUOT; EVENT =" someEvent(random,data)">

alert(" Got Event");

alert("Got Event");

< font face = Arial>< / SCRIPT>

这在IE6中完美无缺,但在IE7中没有任何反应。我附加了一个调试器,我可以看到发送事件的c ++代码,但没有任何反应。

This works perfectly and as expected in IE6, yet nothing happens in IE7. I have attached a debugger, and I can see the c++ code sending the event, but nothing happens.

作为旁注,我也试过调用控件的一些方法暴露,我得到一个JavaScript异常"[对象错误]"。

As a side note, I have also tried calling a few of the methods that the control exposes and I get a javascript exception "[object error]".

我已经尝试了所有的对象激活技巧,这是问题,但似乎没有任何效果。

I have tried all the Object activation tricks incase that was the issue, but that didn't seem to have any effect either.

如果有人知道如何让IE7让事件通过,我很乐意知道。

If anyone knows how to make IE7 let the event through, I'd be happy to know it.

James

推荐答案

您的ActiveX控件是否标记为脚本安全?如果是这样,那么"脚本ActiveX控件被标记为可以安全地编写脚本"。 IE7中的安全选项设置为"启用"?

如果您的ActiveX控件未标记为可安全编写脚本,您可能应该更改=]

但是,有一个安全设置ActiveX控件没有标记为可以安全地编写脚本,您可以在此期间更改,以查看是否是问题或者是否是其他内容。
Is your ActiveX control marked as safe for scripting? If so, is the "Script ActiveX controls marked as safe for scripting" security option in IE7 set to "Enable"?

If your ActiveX control is not marked safe for scripting, you probably ought to change that =]

However, there is a security setting for ActiveX controls not marked safe for scripting that you could change in the meantime, to see if that is the issue or if it is something else.


这篇关于IE 7 ActiveX事件和Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆