ActiveX method call from JavaScript in IE9

I have an activex control on the page. Usually, to call its methods, I use something like this:

document.getElementById('activexControlID').MethodName(2) = 'value string';

I know this may seem strange, but it works fine in IE6, IE7, IE8. Unfortunately, it does not work in IE9. It gives the error "Unable to assign the result of the function."

I have already tried:

document.getElementById('activexControlID').MethodName[2] = 'value string';
// and
document.getElementById('activexControlID').MethodName(2, 'value string');

but no luck.

UPDATE

An expression document.getElementById('activexControlID').MethodName(2) = 'value string';must not return a value. He acts like a setter. In the end, I can get it later with code var value = document.getElementById('activexControlID').MethodName(2);And I can get the value in IE9. But he cannot install it.

I don’t know how it is implemented inside the activex control, but it looks like an array, it just uses () instead of []. And again, it works in previous versions of IE.

UPDATE 2

IE9. .

+3
1

​​,

document.getElementById('activexControlID').MethodName(2) = 'some value';

IE9 RC1.

+1

Source: https://habr.com/ru/post/1787946/


All Articles