Categories | Question details Back To List | ||||||||||||||
I get error "Automation Server can't create object" in IE 7.0. Works in IE 6.0 When my Javascript runs the code below in IE 6.0, the tree is loaded successfully. However, in IE 7.0, I get the error "Automation Server can't create object" when the command "tree2.loadXML("/groups.xml");" is called. tree2=new dhtmlXTreeObject("treeboxbox_tree2","100%","100%",0,document); tree2.setImagePath("/images/treemenu/"); tree2.enableCheckBoxes(1); tree2.enableThreeStateCheckboxes(true); tree2.loadXML("/groups.xml"); Please help me resolve this problem. thanks Answer posted by Support on Mar 06, 2008 02:38 Problem caused by security settings, please be sure that in IE7 next setting is enabled ( it is enabled by default ) Tools => Internet Options => Security => Custom level => Run ActiveX controls and plug-ins => Initialize and script ActiveX control marked as safe. Answer posted by FastLane on Mar 06, 2008 04:43 most of my customers don't have ActiveX enabled. I was able to debug through your application and replaced "this.xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");" with the logic below in the function " dtmlXMLLoaderObject.prototype.loadXML=function(filePath,postMode,postVars,rpc) of the dhtmlXCommon.js file and it worked there. But now it is failing in the line " this.xmlDoc = new ActiveXObject("Microsoft.XMLDOM");" of the function " dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName)" in the same file. If this problem is fixed, it should able to work for users without ActiveX settings. Can you make it work. if (window.XMLHttpRequest){this .xmlDoc = new XMLHttpRequest(); }else if (window.ActiveXObject){try { this .xmlDoc = new ActiveXObject("Microsoft.XMLHTTP"); }catch (e){try{ this .xmlDoc = new ActiveXObject("Msxml2.XMLHTTP") }catch (e){}} } Answer posted by Support on Mar 06, 2008 06:50 >>most of my customers don't have ActiveX enabled The mentioned settings allowed by default, so it must be manually disabled to not work. >>with the logic below in the function IE7 has kown bug, the XMLHttpRequest can't be used against local files ("file://" like urls ), that is why code uses new ActiveXObject("Microsoft.XMLHTTP"); , which is the same way as it works for IE6. In case of proposed changes component will work only for http:// like urls, so it must be used with any kind of webserver. >>But now it is failing in the line " this.xmlDoc = new This lines called when loaded XML container errors, in your case it may occurs if you loaded file from local filesystem ( because of IE7 bug ) or because you are loading data from server side script with incorrect content type ( it need to be text/xml ) Answer posted by FastLane on Mar 06, 2008 07:52 I hear what you are saying about the IE7 bug. IE always has a bug but I care more for my customers who use IE and most people have upgraded to IE7. I have managed to find work arounds in some your your code to overcome some of the IE 7 limitations. But I am stuck here and i really need your assistance. I get the error "Automation Server can't create object" in the command " this.xmlDoc = new ActiveXObject("Microsoft.XMLDOM");" in your function "dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName)" in the file dhtmlXCommon.js Please help me look for a walkaround because my product cannot go live if your product have limitations in IE7. Please help me with a workaround as soon as possible. This works in IE 6.
Answer posted by FastLane on Mar 06, 2008 17:00 Just checking to see if progress is being made. Please try and look for a workaround to enable dhtmlTree work in IE 7 where ActiveX is not enabled. I am using the default settings of IE 7 and I can't instruct my users to upgrade their IE 7.0. thanks Answer posted by Support on Mar 07, 2008 05:36 You can try to use attached js file instead of original dhtmlxcommon.js , it will work for all browsers and will not use activeX in case of IE7, but please beware that it WILL NOT work in case of "file://" like urls. Attachments (1)
Answer posted by FastLane on Mar 07, 2008 08:11 Thanks for your response. I replaced the script with yours and it works in IE6. However, in IE 7, I am still getting the error "Automation Server can't create object" on line 66 of the dhtmlXCommon.js file (I renamed your file to dhtmlXCommon.js) which is "this.xmlDoc = new ActiveXObject("Microsoft.XMLDOM");". So IE7 is having problem with that line of code "this.xmlDoc = new ActiveXObject("Microsoft.XMLDOM");". I am not using the "file://" url. Please review and post your response. thanks Answer posted by Support on Mar 07, 2008 09:05 Such error message may occur only if you are using incorrect XML or sending XML data with incorrect content type. If problem still occurs for you - please provide a sample of XML which cause mentioned problem for you. Answer posted by FastLane on Mar 07, 2008 09:50 Below is the xml that works in IE6. Using the same code etc, it fails in IE 7 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> Answer posted by FastLane on Mar 07, 2008 09:56 For better clarity, I have attached the xml data as an attachment to this post. See xml in attachment Attachments (1)
Answer posted by FastLane on Mar 07, 2008 10:18 You were right about the xml data. The correct xml data was not getting passed. It is now working in IE7 with your new script. I will now test your new script against other browsers. Thanks!! for your response Answer posted by FastLane on Mar 07, 2008 10:25 I tested in Firefox. Why is the size of the box displaying the tree rendered very small compared to IE? Answer posted by Support on Mar 10, 2008 07:37 Please be sure that while defining sized of container DIV you specified height and width with "px" postfix ( FF will ignore sizes without px , which may result in small container size ) |