Hi guys,
I'm trying to get search results from Nominatim in XML format. Here's my javascript code:
function requestToNominatim(){
xmlhttp = getXMLHttpRequest();
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
var response = xmlhttp.responseXML;
alert(response);
}
}
var q = document.getElementById('q').value;
xmlhttp.open("GET","http://localhost/nominatim/search.php?format=xml&q=" + q,true);
xmlhttp.send(null);
}
The alert displays "[object Document]". However, when I display "responseText" I get the xml... Do you have any idea about getting directly the XMLDocument from responseXML?
Thanks! Lucas
asked
14 Jun '13, 14:42
Kalu06
140●7●8●15
accept rate:
0%
Finally, I ended up using JSON instead of XML. It's working as good and easier to manipulate.
Lucas