The following HTML object represents an ActiveX control that has a property named SubSystemA:
<object id="MainObject"
CLASSID="CLSID:2C327457-D12F-4FC4-BFC2-D7C029003D07"
width="0px" height="0px"
>
<embed name="MainObject"></embed>
</object>
SubSystemA is a COM object implementing some interface with methods, properties, and events. SubSystemA's methods and properties are easily callable from Javascript, but since SubSystemA is a property of MainObject, I am not sure how to attach an event handler to SubSystemA's events.
I know of two ways to handle events fired by MainObject:
<script type="text/javascript">
function MainObject::SomeMainEvent(arg1, arg2)
{
// Event handling logic
}
</script>
and
<script type="text/javascript" for="MainObject" event="SomeMainEvent(arg1, arg2)">
// Event handling logic
</script>
But how would one handle an event for MainObject.SubSystemA?
I found that the following works:
<object id="MainObject"
CLASSID="CLSID:2C327457-D12F-4FC4-BFC2-D7C029003D07"
width="0px" height="0px"
>
<embed name="MainObject"></embed>
</object>
<script type="text/javascript">
function MainObject.SubSystemA::SomeSubSystemEvent(arg1)
{
// Event handling logic
}
</script>
and am currently looking for a way to adapt the <script for="..." event="..."> syntax, since it seems to allow later binding where the working syntax does not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With