Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

getting xml from response, make sure server returns valid xml and the "content-type" header is set

var r = dhx.ajax.getSync("server.php");
var items = [];
var xml = r.xmlDoc.responseXML;
var nodes = xml.getElementsByTagName("items");
for (var q=0; q<nodes.length; q++) {
    items.push({
        name:   nodes[q].children[0].getAttribute("name"),
        value:  nodes[q].children[0].getAttribute("value")
    });
}
Source by docs.dhtmlx.com #
 
PREVIOUS NEXT
Tagged: #xml #server #returns #valid #xml #header #set
ADD COMMENT
Topic
Name
9+5 =