Why text() returns empty string on MyPage.aspx ? .find and .filter do find "imagesPaths" node.
<script type="text/javascript" charset="utf-8">
function MyFunction(albumNb)
{
//xmlContent = "<images><imagePaths>2</imagePaths><imageTitles>title1,title2,title3,
//title4</imageTitles></images>"
$.ajax({
url: "MyPage.aspx?albumNb=1",
type: 'GET',
success: function (res) {
var xmlContent = res.xml;
$imagePaths = $(xmlContent).find("imagePaths").text(); //returns empty string, Why?
//$imagePaths = $(xmlContent).filter("imagePaths").text(); //also returns empty string
}
});
}
Thank you
GETting with yourAJAXcall? As @tymeJV suggested, is it actuallyapplication/xmlor is it simply an XML string?res? is it an object? a string? you have no dataType and haven't given us the raw response therefore we have no way of knowing what you are receiving. It could be JSON, XML, Text, HTML, we don't know.