[jQuery] SOS
[jQuery] SOS
hi,
my server side script returns following xml output-
<?xml version="1.0" encoding="UTF-8" ?>
- <markers>
<marker lat="22.8015" lng="91.0986" Device="ET700C" Index="1" />
<marker lat="23.0494" lng="91.4117" Device="ET700C" Index="2" />
<marker lat="23.2666" lng="91.1261" Device="ET700C" Index="3" />
<marker lat="22.6951" lng="90.3845" Device="ET700C" Index="4" />
<marker lat="22.5836" lng="89.9725" Device="ET700C" Index="5" />
<marker lat="23" lng="90" Device="ET700B" Index="1" />
<marker lat="24" lng="90" Device="ET700A" Index="1" />
</markers>
and on my client side, i want to catch it using following code-
$.ajax({
url: "<?=base_url();?>Main/Mova",
global: false,
type: "POST",
async: false,
dataType: "responseXML",
data: "first_select="+ valore, //the name of the $_POST
variable and its value
success: function (request) //'response' is the output
provided by the controller method prova()
{
$(request).find("marker").each(function()
{
alert("Hello"); // alert 1
//alert($
(request).find("marker").attr("lat"));
})
alert(request); //alert 2
}
});
------------------------------------------------------------------------------------------------------------------------
alert 2 prints alright(The XML), but, i am not getting anything from
alert 1, how do i access xml elements?
please help.