So you're making an ajax call on each node expansion to get it's children is that?
In response you get XML and want to parse it so that you'll be able to inject the new nodes under the parent... correct?
Basically you can parse your response xml string like:
var txt = '-> XML String goes here <-';var xmlDoc;if (window.DOMParser) { var parser=new DOMParser(); xmlDoc=parser.parseFromString(txt,"text/xml"); }else // Internet Explorer { xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.loadXML(txt); }
An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
In response you get XML and want to parse it so that you'll be able to inject the new nodes under the parent... correct?
My first question is: Can't you return json instead of XML?
Dealing with XML in javascript is slow and a mess...
http://www.w3schools.com/xml/xml_parser.asp
Basically you can parse your response xml string like:
Open in new window
after this, xmlDoc will contain the structure of your XML data and you can access it normally with the dot notation.