Click here to Skip to main content
12,246,601 members (48,857 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ActiveX
The OCX in the IE9 ,I can use JQuery to get the OCX object, but the IE9 tell me the OCX object can't support the method.
The code is : if ($('#xlist').length == 0) {
var obj = '<object id="xlist" style="width:100%;height:100%;" codebase="' + urlPrefix + 'Content/xpmbrows.cab#version=' + jmversion + '" classid="CLSID:E80A2A71-0A34-4301-A65E-9593C8DC6265"></object>';
$("#main").html('');
$('#container').html(obj).show();
ocx = $("#xlist");
//ocx.openmodulerec('a', 'b');
alert("aa");
alert(ocx);
ocx.initOCX('cn.language', d, b, e);
IE9 tell me the Object doesn't support property or method 'initOCX'.
Posted 10-Aug-12 6:46am
wf0007406
Edited 12-Aug-12 16:35pm
v2
Comments
Wes Aday 10-Aug-12 11:51am
   
Do you think that "it can't load successfully" tells anyone anything? Do you call your mechanic on the phone and tell him that your car "is broke" and expect he knows exactly what you mean?
aspnet_regiis 10-Aug-12 12:41pm
   
"can't load successfully" is bad description of problem

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

IE9 is touch more pedantic than the previous versions as regards security for AX objects

The 3 problems to solve are

1. Allowing code to be downloaded
2. Allowing code to be loaded
3. Allowing script to be run

You can turn these checks off in Options/Security, but i'd suggest you're better off fixing the root problem

First, establish if your component is actually being loaded by IE, you can do that a number of ways

1. Put a breakpoint in your FinalConstruct() for the class and debug it by running IE
2. Put a message box in your FinalContruct()

If it is being loaded, then it's probably a 'safe for scripting' issue, again, ISTR that IE9 prefers the IObjectSafety mechanism to the legacy registry method
  Permalink  
Comments
wf0007 14-Aug-12 3:52am
   
Thank you very much, I have been with you the method to solve the problem. but I also modify
my code . I use the document.getElementById("xlist") to get the Object .The object is obtained by JQuery also tell me Object doesn't support property or method 'initOCX'.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 12 Aug 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100