Categories | Question details Back To List | ||
temp has no properties Hello, Thanks for the amazing dhtmlx components. I am using standard edition of dhtmlxtree. But met a very strange problem. I created a test page and use jsp to fetch subnodes: <body> <div class="hdr">DHTML JavaScript Tree samples</div> <link rel="STYLESHEET" type="text/css" href="./dhtmlXTree.css"> <script src="./dhtmlXCommon.js"></script> <script src="./dhtmlXTree.js"></script> <table class="content_bordered" cellspacing="2" cellpadding="2"> <tr> <td> <div id="biomodels_go_tree" style="width:250; height:218;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"></div> <script> tree=new dhtmlXTreeObject("biomodels_go_tree","100%","100%",0); tree.setImagePath("./treeImg/"); tree.setXMLAutoLoading("test.do?cmd=SUBNODES"); tree.loadXML("tree.xml"); </script> </td> </tr> </table> <body> By using debugging tool(such as firebug), I saw the AJAX request successfully fetched back data in xml. But it always show error "temp has no properties" and the node could not be expanded. But if I copy the response into an xml file and change to tree.setXMLAutoLoading("manuallycreatedxml.xml"). It worked. Could anybody give me any clue? Thank you very much. Chen Answer posted on Oct 18, 2007 03:54 There are few additional requirements to process XML correctly a) Response must contain correct content type ( ctitical for IE7), for JSP it must be something similar to next <%@ page language="java" contentType="text/xml; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> b) For FF - there must not be any whitespaces before starting <?xml tag ( or starting <?xml tag must absent at all ) |