XML help..
XML help..
hi,
i am badly stuck, in need of 'SOS' help.
THE PROBLEM--
my php server sends xml document as echos--
like echo "<option>".$value."</option>"
i want to receive it on my user end using Ajax. here is my code ( i am usin CI)
-
url: "<?=base_url();?>Main/prova",
global: false,
type: "POST",
async: false,
dataType: "html", // "xml doesn't work "
data: "first_select="+ valore, //the name of the $_POST variable and its value
success: function (xml) //'response' is the output provided by the controller method prova()
{
var xmlDoc = xml.ResponseXML;
try // Build Markers, if available
{
alert(xml);
var markers = xmlDoc.getElementsByTagName("option") ;
for ( var i = 0; i < markers.length ; i++ )
{
var point = {
markers[i].getAttribute("lat")),
markers[i].getAttribute("lng")
};
}
} catch(e) {}
above code is not working, since xmlDoc.getElementsByTagName("") is not working properly.
is it possible to handle data without .xml document, to parse xml data.
regards
maruf