小编Bra*_*ton的帖子

处理HTML / Javascript中ActiveX控件的属性触发的事件

以下HTML对象表示一个ActiveX控件,该控件具有名为SubSystemA的属性:

<object id="MainObject"
    CLASSID="CLSID:2C327457-D12F-4FC4-BFC2-D7C029003D07"
    width="0px" height="0px"
    >
    <embed name="MainObject"></embed>
</object>
Run Code Online (Sandbox Code Playgroud)

SubSystemA是一个COM对象,使用方法,属性和事件来实现某些接口。SubSystemA的方法和属性可以从Java脚本轻松调用,但是由于SubSystemA是MainObject的属性,因此我不确定如何将事件处理程序附加到SubSystemA的事件。

我知道两种处理MainObject触发的事件的方法:

<script type="text/javascript">
    function MainObject::SomeMainEvent(arg1, arg2)
    {
         // Event handling logic
    }
</script>
Run Code Online (Sandbox Code Playgroud)

<script type="text/javascript" for="MainObject" event="SomeMainEvent(arg1, arg2)">
    // Event handling logic
</script>
Run Code Online (Sandbox Code Playgroud)

但是如何处理MainObject.SubSystemA的事件?

html javascript events activex event-handling

5
推荐指数
1
解决办法
7004
查看次数

标签 统计

activex ×1

event-handling ×1

events ×1

html ×1

javascript ×1