Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
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
Updated 12-Aug-12 15:35pm
v2
Comments
[no name] 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?
bbirajdar 10-Aug-12 12:41pm    
"can't load successfully" is bad description of problem

1 solution

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
 
Share this answer
 
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900