Javascript: “Object does not support this property or method” when invoking an ActiveX object

I have a simple html on Login.aspx with an ActiveX object:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><title></title>
<script language="javaScript" type="text/javascript"> 

    function getUserInfo() 
    {
        var userInfo = MyActiveX.GetInfo();
        form1.info.value = userInfo;
        form1.submit();
    }

</script>
</head>

<body onload="javascript:getUserInfo()">
<object id="MyActiveX" name="MyActiveX" codebase="MyActiveX.cab" classid="CLSID:C63E6630-047E-4C31-H457-425C8412JAI25"></object>
    <form name="form1" method="post" action="Login.aspx">
        <input type="hidden" id="info" name="info" value="" />
    </form>
</body>
</html>

The code works fine on my machine (editing: placement and launch), it doesn’t work on the other: there is a "Object does not support this property or method" error in the first line of the javascript function, the cab file is in the same folder as the page file. I don’t know javascript at all and have no idea why the problem arises. Googling didn't help. Do you have any idea?

Edit: IE was used on both machines, and activex was enabled.

Edit2: if (document.MyActiveX) , - , document.MyActiveX ,

+5
5

, onload , ActiveX . :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title></title>
        <script language="javaScript" type="text/javascript">
            function getUserInfo(){
                if(document.MyActiveX){
                    var userInfo = MyActiveX.GetInfo();
                    form1.info.value = userInfo;
                    form1.submit();
                }
            }
        </script>
    </head>
    <body>
        <object id="MyActiveX" name="MyActiveX" codebase="MyActiveX.cab" classid="CLSID:C63E6630-047E-4C31-H457-425C8412JAI25"></object>
        <script for="window" event="onload" language="JavaScript">
            window.setTimeout("getUserInfo()", 500);
        </script>

        <form name="form1" method="post" action="Login.aspx">
            <input type="hidden" id="info" name="info" value="" />
        </form>
    </body>
</html>

getUserInfo() 500 . ActiveX.

+2

IE8 ActiveX .

:

  • IE8, →
  • " " ActiveX
  • -
  • -
  • Enjoy
+2

Perhaps the browser on another computer does not support activeX? just a wild guess

0
source

Perhaps ActiveX requires some prerequisite (such as CRuntime runtime) that is not available on other machines? Have you tried running ActiveX- dependent hosting?

0
source

Maybe on another machine there is an antivirus or similar that silently prevents the use of ActiveX?

0
source

All Articles