johannitis
Programmer
I am successfully pulling xml data from VFP and Webconnect and the success stops there. I want to populate a combo box with the xml, but can't seem to get it done. Here is a sample of the xml and some code that will return the list.
<?xml version = "1.0" encoding="UTF-8"
standalone="yes"?>
<officials>
<official>John Doe</official>
</officials>
<officials>
<official>Jane Doe</official>
</officials>
<officials>
<official>Jack Smith</official>
</officials>
<officials>
<official>Bill Williams</official>
</officials>
I create the ajax request object and call the url which will return an xml string.
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
If I put the following in an alert, it will show the xml:
alert(ajaxRequest.responseText);
However, if I try to determine how many elements or display and element with the following, it doesn't work. I get an alert that says object.
alert(ajaxRequest.responseXML.getElementsByTagName("officials")[0]);
Can anyone shed some light on this?
Do I need to format the xml differently?
<?xml version = "1.0" encoding="UTF-8"
standalone="yes"?>
<officials>
<official>John Doe</official>
</officials>
<officials>
<official>Jane Doe</official>
</officials>
<officials>
<official>Jack Smith</official>
</officials>
<officials>
<official>Bill Williams</official>
</officials>
I create the ajax request object and call the url which will return an xml string.
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
If I put the following in an alert, it will show the xml:
alert(ajaxRequest.responseText);
However, if I try to determine how many elements or display and element with the following, it doesn't work. I get an alert that says object.
alert(ajaxRequest.responseXML.getElementsByTagName("officials")[0]);
Can anyone shed some light on this?
Do I need to format the xml differently?