Hi,
I am trying to extract the data from xml returned from Ajax call. I
have tried more than one way to access the <xml1> node from the xml,
but couldn't get it. Can you please suggest?
<code>
XML response
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <root>
<xml1> am desperate; find me </xml1>
</root>
Ajax call
jQuery.ajax
({
url:"http://localhost/website/ajax/
ajserver.aspx" ,
type:"POST",
cache:false,
data:"CatType="+cat,
dataType:"xml",
complete:function(xml)
{
alert( $
("xml1",xml.responseXML).text() );
alert( $
('xml1',xml.responseXML).text() );
alert( jQuery('/root/
xml1',xml).text() );
$(xml).find("root").each
( function()
{
var _text = $(this).text();
//alert(_text);
}
)
}
});
Thanks
Shyam