(This question has been asked before, about three years ago, and didn’t receive an answer. I’m hoping someone’s found a solution since then!)
I have a COM (automation, activex) object, that generates events, that I want to capture in JavaScript in Internet Explorer. I know that the events are being generated, and making it back to my script, because the following works:
<object id=”foo” classid=”clsid:…” ></object>
<script language=”javascript”>
function foo::OnEvent() { alert(‘Boo!’) }
// …other code to call methods on ‘foo’
</script>
However, I want to create the object using ActiveXObject:
var myobj = new ActiveXObject(‘…’)
and then associate my event handler function with ‘myobj’. I have tried every syntactic variation I can think of with no success, and can find no documentation on doing it this way. So…
– if it’s possible, does anyone know how please?– or can anyone confirm if this is definitely not possible?– if it’s not possible, what are the downsides (if any) to using <object> to create the object, instead of ActiveXObject?
Many thanks for any help,
Scott